molroo docs
WorldAPI Reference

Endpoints

REST API endpoints for api.molroo.io — world management and persona interactions.

World API Endpoints

The World API is available at https://api.molroo.io. All endpoints require authentication via the X-API-Key header.

Base URL

https://api.molroo.io

Authentication

Include your API key in every request:

curl https://api.molroo.io/worlds \
  -H "X-API-Key: mk_live_xxxxx"

The World API shares the same API key system as the persona API.

Endpoint Groups

Worlds

MethodPathDescription
POST/worldsCreate a new world
GET/worldsList worlds (cursor-based pagination)
GET/worlds/{id}Get world details
PATCH/worlds/{id}Update world config
DELETE/worlds/{id}Soft-delete a world

World Personas

MethodPathDescription
POST/worlds/{id}/personasAdd a persona to the world
GET/worlds/{id}/personasList personas in the world
GET/worlds/{id}/personas/{pid}Get persona details and current emotional state
DELETE/worlds/{id}/personas/{pid}Remove a persona from the world

World Actions

MethodPathDescription
POST/worlds/{id}/actionsCreate a custom action for the world
GET/worlds/{id}/actionsList available actions (defaults + custom)
DELETE/worlds/{id}/actions/{aid}Delete a custom action

Interactions & Events

MethodPathDescription
POST/worlds/{id}/interactExecute an action against a persona (billable)
GET/worlds/{id}/eventsGet the world event log

World Relationships

MethodPathDescription
PUT/worlds/{id}/relationshipsUpsert a relationship between an actor and a persona
GET/worlds/{id}/relationshipsList all relationships in the world
DELETE/worlds/{id}/relationships/{rid}Delete a relationship

Response Format

All successful responses are wrapped in a result envelope:

{
  "result": {
    // response data
  }
}

Error responses use a standard error format:

{
  "error": {
    "code": "WORLD_NOT_FOUND",
    "message": "World abc123 not found"
  }
}

OpenAPI Specification

The full OpenAPI specification is auto-generated from Zod schemas and available at:

https://api.molroo.io/openapi.json

On this page