HTTP API Reference
HTTP, WebSocket, and SSE API for the mooR virtual-world server.
Content negotiation — Most /v1/* endpoints support two response formats selected via the
Accept header:
| Accept value | Response format |
|---|---|
application/x-flatbuffers | FlatBuffers binary (default) |
application/json | JSON |
If neither is acceptable, the server returns 406 Not Acceptable.
Authentication — Authenticated endpoints require an X-Moor-Auth-Token header containing a
PASETO v4.public token obtained from /auth/connect or /auth/create. Some endpoints also require
X-Moor-Client-Token and X-Moor-Client-Id headers for session continuity.
Errors — When the daemon refuses a request, the response has the status that fits why and a JSON
body {"code": "...", "error": "..."}, even when FlatBuffers were requested. Codes include
unauthorized (401), invalid_request and invalid_value (400), permission_denied (403),
object_not_found, verb_not_found and property_not_found (404), compilation_error (422, with
the compiler's diagnostics in compile_error), and daemon_unavailable (503). A server error (500)
has code internal_error and a generic message. An error status means no task ran. Once a task
runs, how it ended is not an HTTP error: the response has status 200 and an InvocationResponse
whose outcome is a TaskOutcome.
Task outcomes — A TaskOutcome has an ending and a kept field. The ending is
TaskCompleted (with the task's value), TaskSuspended, TaskAborted (with an AbortReason: a
limit, an uncaught exception, verb not found, command failed, cancelled, killed, rolled back,
conflict retries exhausted, the call's deadline, or an internal error), or TaskResultLost. kept
says whether the task's last transaction committed: Yes, No or Unknown. As in LambdaMOO, a
task that ends in an uncaught error or runs out of ticks keeps its changes, so an aborted task can
have kept: Yes.
FlatBuffers note — FlatBuffer request/response bodies are opaque binary blobs whose schemas are
defined in the moor-schema crate. This spec documents their logical content in prose; the wire
format is governed by the .fbs files, not JSON Schema.
Auth
Password-based authentication (login / validate / logout)
POST /auth/connect
Authenticate an existing player
Runs the connect login command against the daemon. On success the response body is a FlatBuffer
LoginResult and the three session headers are set.
Request body (required)
-
Content-Type:
application/x-www-form-urlencodedField Type Required Description playerstring Yes Player name passwordstring Yes Player password
Responses
- 200: Login successful
- Header
X-Moor-Auth-Token: PASETO auth token for subsequent requests - Header
X-Moor-Client-Token: Session token for this connection - Header
X-Moor-Client-Id: Unique ID for this client session - Content-Type:
application/x-flatbuffers
- Header
- 401: Missing or invalid auth token
- 403: Login rejected by daemon
- 500: Internal server error
- 502: Malformed response from daemon
- 503: Daemon is unreachable
POST /auth/create
Create a new player account
Runs the create login command against the daemon. Identical to /auth/connect except the daemon
verb is :do_login_command("create", …).
Request body (required)
-
Content-Type:
application/x-www-form-urlencodedField Type Required Description playerstring Yes Player name passwordstring Yes Player password
Responses
- 200: Account created and logged in
- Header
X-Moor-Auth-Token - Header
X-Moor-Client-Token - Header
X-Moor-Client-Id - Content-Type:
application/x-flatbuffers
- Header
- 401: Missing or invalid auth token
- 403: Account creation rejected by daemon
- 500: Internal server error
- 502: Malformed response from daemon
- 503: Daemon is unreachable
GET /auth/validate
Validate an auth token
Round-trips to the daemon to verify the token is still valid. An ephemeral attach/detach is performed; the connection is cleaned up automatically.
Requires: X-Moor-Auth-Token
Responses
- 200: Token is valid (empty body)
- 401: Missing or invalid auth token
- 503: Daemon is unreachable
POST /auth/logout
Explicitly log out a player session
Sends a detach message to the daemon with disconnected=true, triggering user_disconnected.
Requires both the auth token and client credentials.
Requires: X-Moor-Auth-Token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Moor-Client-Token | header | string | Yes | Client session token from login response |
X-Moor-Client-Id | header | string (uuid) | Yes | Client session UUID from login response |
Responses
- 200: Logout successful (empty body)
- 401: Missing or invalid auth token
- 500: Internal server error
OAuth2
OAuth2 federated authentication. These routes are only registered when OAuth2 is enabled in the server configuration; otherwise they return 404.
GET /v1/oauth2/config
Get OAuth2 configuration
Returns whether OAuth2 is enabled and the list of configured providers. Route is only present when OAuth2 is enabled.
Responses
- 200: OAuth2 configuration
- Content-Type:
application/json
- Content-Type:
- 404: OAuth2 not enabled (route absent)
GET /auth/oauth2/{provider}/authorize
Start a cookie-bound OAuth2 authorization flow
Generates a provider authorization URL and a CSRF state token. Sets a moor_oauth_nonce cookie for
cookie-bound redemption.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | path | string | Yes | OAuth2 provider identifier |
Responses
- 200: Authorization URL generated
- Header
Set-Cookie:moor_oauth_nonceHttpOnly cookie - Content-Type:
application/json
- Header
- 400: Unknown provider
- Content-Type:
application/json
- Content-Type:
- 404: OAuth2 not enabled
POST /auth/oauth2/{provider}/app/start
Start a proof-bound OAuth2 authorization flow
Starts OAuth2 for clients that do not rely on browser cookies. Stores redirect target + PKCE
challenge server-side and returns an authorization URL. Callback redirects to the app redirect URI
with a one-time handoff_code.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | path | string | Yes | OAuth2 provider identifier |
Request body (required)
-
Content-Type:
application/jsonField Type Required Description redirect_uristring Yes Redirect target for proof-bound callback handoff intentstring No Optional client-defined intent/context code_challengestring Yes PKCE code challenge (S256) code_challenge_methodS256Yes
Responses
- 200: Authorization URL generated
- Content-Type:
application/json
- Content-Type:
- 400: Invalid provider, redirect URI, or PKCE input
- Content-Type:
application/json
- Content-Type:
- 404: OAuth2 not enabled
GET /auth/oauth2/{provider}/callback
OAuth2 provider callback
Called by the OAuth2 provider after user consent. Validates the CSRF state, exchanges the authorization code for user info, and redirects according to flow binding:
- Cookie-bound existing user →
/#auth_code={code} - Cookie-bound new user →
/#oauth2_code={code}&oauth2_display={json} - Proof-bound →
{redirect_uri}?handoff_code={code}
The code is a server-side one-time token redeemable via /auth/oauth2/exchange (cookie) or
/auth/oauth2/app/exchange (proof).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | path | string | Yes | OAuth2 provider identifier |
code | query | string | Yes | Authorization code from the OAuth2 provider |
state | query | string | Yes | CSRF state token |
Responses
- 302: Redirect to client with one-time code in fragment
- 404: OAuth2 not enabled (route absent)
POST /auth/oauth2/exchange
Exchange a cookie-bound one-time code for tokens or identity
Redeems a server-side one-time code produced by the callback. Returns either an auth_session
(existing user) or an identity (new user needing account choice). Requires the moor_oauth_nonce
cookie.
Request body (required)
-
Content-Type:
application/jsonField Type Required Description codestring Yes One-time server-side code from callback redirect
Responses
- 200: Code exchanged
- Content-Type:
application/json
- Content-Type:
- 401: Invalid/expired code or missing nonce cookie
- Content-Type:
application/json
- Content-Type:
- 404: OAuth2 not enabled (route absent)
POST /auth/oauth2/app/exchange
Exchange a proof-bound handoff code
Redeems a one-time proof-bound handoff code using a PKCE verifier. Returns an auth session for
existing users, or identity details plus an identity_code for account-choice submission.
Request body (required)
-
Content-Type:
application/jsonField Type Required Description handoff_codestring Yes One-time handoff code from callback redirect code_verifierstring Yes PKCE verifier matching the start request challenge
Responses
- 200: Code exchanged
- Content-Type:
application/json
- Content-Type:
- 401: Invalid/expired code or invalid verifier
- Content-Type:
application/json
- Content-Type:
- 404: OAuth2 not enabled (route absent)
POST /auth/oauth2/account
Create or link an account after OAuth2
Submits the user's account-choice decision (create new player or link to existing player). The
oauth2_code must resolve to a verified Identity on the server side. Requires moor_oauth_nonce
cookie.
Request body (required)
-
Content-Type:
application/jsonField Type Required Description modeoauth2_create|oauth2_connectYes oauth2_codestring Yes One-time code from callback redirect player_namestring No Desired player name (for oauth2_create) existing_emailstring No Email of existing account to link (for oauth2_connect) existing_passwordstring No Password of existing account (for oauth2_connect)
Responses
- 200: Account created/linked, session established
- Content-Type:
application/json
- Content-Type:
- 400: Invalid mode or code type mismatch
- Content-Type:
application/json
- Content-Type:
- 401: Authentication failed or invalid code
- Content-Type:
application/json
- Content-Type:
- 404: OAuth2 not enabled
- 500: Internal server error
POST /auth/oauth2/app/account
Create or link account using proof-bound identity code
Submits account-choice for proof-bound OAuth2 flows. Requires identity_code and PKCE
code_verifier; no nonce cookie.
Request body (required)
-
Content-Type:
application/jsonField Type Required Description modeoauth2_create|oauth2_connectYes identity_codestring Yes One-time identity code from /auth/oauth2/app/exchangecode_verifierstring Yes PKCE verifier used to bind account-choice redemption player_namestring No Desired player name (for oauth2_create) existing_emailstring No Email of existing account to link (for oauth2_connect) existing_passwordstring No Password of existing account (for oauth2_connect)
Responses
- 200: Account created/linked, session established
- Content-Type:
application/json
- Content-Type:
- 400: Invalid mode or code type mismatch
- Content-Type:
application/json
- Content-Type:
- 401: Authentication failed or invalid code
- Content-Type:
application/json
- Content-Type:
- 404: OAuth2 not enabled
- 500: Internal server error
WebSocket
WebSocket connections for real-time interaction
GET /ws/attach/connect
WebSocket upgrade — attach with existing player
Upgrades to a WebSocket connection for an already-authenticated player (the connect login path).
Auth credentials can be passed as HTTP headers or via Sec-WebSocket-Protocol subprotocols:
| Subprotocol prefix | Equivalent header |
|---|---|
paseto.{token} | X-Moor-Auth-Token |
client_id.{uuid} | X-Moor-Client-Id |
client_token.{t} | X-Moor-Client-Token |
initial_attach.{bool} | (session hint) |
The server selects moor as the WebSocket subprotocol.
Note: Full WebSocket message framing is FlatBuffer-based and is outside the scope of this HTTP spec.
Requires: X-Moor-Auth-Token
Responses
- 101: WebSocket upgrade successful
- 401: Missing or invalid auth token
- 500: Internal server error
GET /ws/attach/create
WebSocket upgrade — attach with new player
Same as /ws/attach/connect but used when the player was created via /auth/create. See that
endpoint for auth details.
Requires: X-Moor-Auth-Token
Responses
- 101: WebSocket upgrade successful
- 401: Missing or invalid auth token
- 500: Internal server error
EventDelivery
Daemon-owned delivery queues with SSE payloads and browser acknowledgements
POST /v1/session
Attach a browser-acknowledged session
Attaches a connection or reuses valid per-tab connection credentials. The optional client headers select a connection to reattach. The initial flag requests the login lifecycle callback. The create flag selects the new-player callback. The daemon retains all live payloads. Streaming a payload never acknowledges delivery. The JSON reply contains client_id, client_token, stream_id, acknowledged_sequence, available_after, and latest_sequence. Sequence fields are decimal strings. Each stream generation has its own sequence space.
Requires: X-Moor-Auth-Token
Request body (required)
-
Content-Type:
application/jsonField Type Required Description initialboolean No createboolean No
Responses
- 200: Session credentials and stream metadata
- Content-Type:
application/json
- Content-Type:
- 400: Invalid request or sequence beyond the stream watermark
- 401: Missing or invalid credentials
- 410: Connection, stream generation, or retained delivery expired
- 502: Daemon request failed
GET /v1/events/stream
Stream base64 FlatBuffer event payloads
Each delivery event carries a standard base64-encoded ClientEvent FlatBuffer in data. Its SSE id is
<stream_id>:
The after cursor is exclusive and identifies the last event processed by the browser. Neither after nor Last-Event-ID acknowledges delivery. Only the explicit ACK releases payloads.
The web-host reads bounded batches from the daemon as the HTTP response is consumed. Periodic reads recover missed pubsub notifications. Idle streams emit heartbeat events; these contain a decimal cursor and do not advance the browser's processed sequence.
A reset event requires a fresh connection and history/presentation recovery. A retry event indicates a delivery error. An expired cursor returns 410 before streaming starts.
Reconnects and ACK requests can use different web-host instances sharing the same daemon. The response disables proxy buffering with X-Accel-Buffering: no.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Moor-Client-Token | header | string | Yes | Client session token from login response |
X-Moor-Client-Id | header | string (uuid) | Yes | Client session UUID from login response |
stream_id | query | string (uuid) | Yes | Stream generation from session attachment |
after | query | integer (uint64) | No | Last processed sequence; does not acknowledge delivery (default: 0) |
Responses
- 200: SSE payload stream with periodic heartbeats
- Content-Type:
text/event-stream
- Content-Type:
- 400: Invalid request or sequence beyond the stream watermark
- 401: Missing or invalid credentials
- 410: Connection, stream generation, or retained delivery expired
- 502: Daemon request failed
POST /v1/events/ack
Acknowledge all processed deliveries through a sequence
Acknowledges the highest contiguous sequence that the application processed. The daemon removes payloads through that sequence. Duplicate and older acknowledgements are harmless. An acknowledgement beyond the stream watermark is invalid. The stream generation rejects late acknowledgements from another generation. An expired unacknowledged gap requires recovery. Acknowledgement also renews connection liveness. Idle clients send their current acknowledgement every 10 seconds.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Moor-Client-Token | header | string | Yes | Client session token from login response |
X-Moor-Client-Id | header | string (uuid) | Yes | Client session UUID from login response |
Request body (required)
-
Content-Type:
application/jsonField Type Required Description stream_idstring (uuid) Yes sequencestring Yes
Responses
- 204: Acknowledgement accepted
- 400: Invalid request or sequence beyond the stream watermark
- 401: Missing or invalid credentials
- 410: Connection, stream generation, or retained delivery expired
- 502: Daemon request failed
POST /v1/session/command
Submit a command on the attached connection
Runs the command with connected invocation semantics. Output and task completion arrive through the event stream. The client serializes commands until completion or suspension. The client does not automatically retry commands after a lost HTTP response.
Requires: X-Moor-Auth-Token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Moor-Client-Token | header | string | Yes | Client session token from login response |
X-Moor-Client-Id | header | string (uuid) | Yes | Client session UUID from login response |
Request body (required)
- Content-Type:
text/plain
Responses
- 202: Command submitted
- 400: Invalid request or sequence beyond the stream watermark
- 401: Missing or invalid credentials
- 410: Connection, stream generation, or retained delivery expired
- 502: Daemon request failed
POST /v1/session/input/{request_id}
Reply to a connection input request
Submits input for the request UUID from RequestInputEvent. Text bodies become MOO strings. A FlatBuffer body contains a serialized Var. Input requests take precedence over queued commands.
Requires: X-Moor-Auth-Token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Moor-Client-Token | header | string | Yes | Client session token from login response |
X-Moor-Client-Id | header | string (uuid) | Yes | Client session UUID from login response |
request_id | path | string (uuid) | Yes | Input request UUID |
Request body (required)
- Content-Type:
text/plain - Content-Type:
application/x-flatbuffers
Responses
- 204: Input accepted
- 400: Invalid request or sequence beyond the stream watermark
- 401: Missing or invalid credentials
- 410: Connection, stream generation, or retained delivery expired
- 502: Daemon request failed
Commands
MOO command execution
POST /v1/command
Execute a MOO command and return its result
The daemon parses and executes one MOO command as the authenticated player. The request does not create a persistent connection. Input requests fail. Output from forked tasks is not included.
The daemon processes the command in this order:
- If
#0:do_commandexists, the daemon calls it first. - If
#0:do_commandreturns a true value, the task succeeds with that value. - If the verb is absent or returns false, the daemon uses the normal command parser.
- If the parser rejects the input, the task aborts with
AbortedCommandFailed(CouldNotParseCommand). - If no command verb matches and the player has a location, the daemon calls
:huhthere. - If the player has no location or
:huhdoes not exist, the task aborts withAbortedCommandFailed(NoCommandMatch).
Any invoked verb can return a value or raise an error. This includes #0:do_command, the selected
command verb, and :huh. The result becomes the invocation outcome. The protocol does not create an
"I do not understand" message. If :huh creates this message, it is ordinary narrative output.
Permission and database errors use the corresponding AbortedCommandFailed variant. Deadlines,
cancellation and uncaught errors use their own AbortReason variants. All of these appear in the
TaskOutcome.
A valid HTTP request receives status 200 after the task finishes. HTTP status 200 does not mean that
the MOO task succeeded. InvocationResponse.outcome says how the task ended and whether its changes
were kept. The output field contains committed root-task output for every outcome. It can contain
output committed before the task aborted.
HTTP status 400 means that the HTTP request is invalid. This includes an invalid timeout or a body that is not valid UTF-8. A MOO parse error is a completed task response with HTTP status 200.
Requires: X-Moor-Auth-Token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
timeout_ms | query | integer (uint64) | No | Deadline in milliseconds. Omit it or use zero for the daemon maximum. A positive value above the daemon maximum returns 400. A task still running at the deadline is cancelled, and the response has status 200 and outcome AbortedDeadline with kept: No, unless the task had already committed. (default: 0) |
Request body (required)
-
Content-Type:
text/plainExample:
look
Responses
- 200: Completed command invocation.
InvocationResponse.outcomesays how the task ended. The HTTP status remains 200 when the task aborted.- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 400: Invalid timeout, or the request body is not valid UTF-8
- 401: Missing or invalid auth token
- 406: Accept header does not include
application/x-flatbuffersorapplication/json - 415: Unsupported Content-Type
- 500: Internal server error
- 503: Daemon is unreachable
Eval
Server-side MOO expression evaluation
POST /v1/eval
Evaluate a MOO expression
The daemon evaluates a MOO expression as the authenticated player. The request creates no daemon
connection. The response contains the task's outcome and committed root-task output. Code that does
not compile runs no task and returns status 422 with code compilation_error; the body's
compile_error gives the position and the problem.
Requires: X-Moor-Auth-Token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
timeout_ms | query | integer (uint64) | No | Deadline in milliseconds. Omit it or use zero for the daemon maximum. A positive value above the daemon maximum returns 400. A task still running at the deadline is cancelled, and the response has status 200 and outcome AbortedDeadline with kept: No, unless the task had already committed. (default: 0) |
Request body (required)
-
Content-Type:
text/plainExample:
player:name()
Responses
- 200: The task's outcome, with committed narrative output
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 400: Invalid timeout
- 401: Missing or invalid auth token
- 406: Accept header does not include
application/x-flatbuffersorapplication/json - 422: The code does not compile, so no task ran. The JSON body has code
compilation_error, anerrormessage, andcompile_errorwith the compiler's diagnostics.- Content-Type:
application/json
- Content-Type:
- 500: Internal server error
- 503: Daemon is unreachable
Verbs
Verb listing, retrieval, programming, and invocation
GET /v1/verbs/{object}
List verbs on an object
Requires: X-Moor-Auth-Token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
object | path | string | Yes | Object reference in CURIE form (e.g. moor:1 or moor:system) |
inherited | query | boolean | No | Include inherited verbs (default: false) |
Responses
- 200: Verb listing
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 400: Invalid object CURIE
- 401: Missing or invalid auth token
- 403: The player may not read or change it. The body is a JSON error with code
permission_denied. - 404: The object, verb, or property does not exist. The body is a JSON error with code
object_not_found,verb_not_found, orproperty_not_found. - 406: Accept header does not include
application/x-flatbuffersorapplication/json - 500: Internal server error
- 503: Daemon is unreachable
GET /v1/verbs/{object}/{name}
Retrieve a single verb
Requires: X-Moor-Auth-Token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
object | path | string | Yes | Object reference in CURIE form (e.g. moor:1 or moor:system) |
name | path | string | Yes | Verb name |
Responses
- 200: Verb details
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 400: Invalid object CURIE
- 401: Missing or invalid auth token
- 403: The player may not read or change it. The body is a JSON error with code
permission_denied. - 404: The object, verb, or property does not exist. The body is a JSON error with code
object_not_found,verb_not_found, orproperty_not_found. - 406: Accept header does not include
application/x-flatbuffersorapplication/json - 500: Internal server error
- 503: Daemon is unreachable
POST /v1/verbs/{object}/{name}
Set a verb's program code
Uploads MOO source code for a verb as the authenticated player. This operation does not create daemon connection state.
Requires: X-Moor-Auth-Token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
object | path | string | Yes | Object reference in CURIE form (e.g. moor:1 or moor:system) |
name | path | string | Yes | Verb name |
Request body (required)
-
Content-Type:
text/plainExample:
return "Hello, " + argstr + "!";
Responses
- 200: Programming result
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 400: Invalid object CURIE
- 401: Missing or invalid auth token
- 406: Accept header does not include
application/x-flatbuffersorapplication/json - 500: Internal server error
- 503: Daemon is unreachable
POST /v1/verbs/{object}/{name}/invoke
Invoke a verb and return the result
Calls a verb on the specified object with FlatBuffer- or JSON-encoded arguments. The verb runs as the authenticated player and with that authority. The request creates no daemon connection.
The InvocationResponse contains the result or error and committed root-task output. A failed call
includes notifications committed before the error and its traceback. Output from forked tasks is not
included. An input request fails the task.
Requires: X-Moor-Auth-Token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
object | path | string | Yes | Object reference in CURIE form (e.g. moor:1 or moor:system) |
name | path | string | Yes | Verb name |
timeout_ms | query | integer (uint64) | No | Deadline in milliseconds. Omit it or use zero for the daemon maximum. A positive value above the daemon maximum returns 400. A task still running at the deadline is cancelled, and the response has status 200 and outcome AbortedDeadline with kept: No, unless the task had already committed. (default: 0) |
Request body (required)
-
Content-Type:
application/x-flatbuffers -
Content-Type:
application/jsonField Type Required Description argsarray Yes Example:
{ "args": [ { "VarInt": { "value": 7 } }, { "VarStr": { "value": "argument" } } ] }
Responses
- 200: Verb call result
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 400: Invalid timeout, object CURIE, or request body
- 401: Missing or invalid auth token
- 406: Accept header does not include
application/x-flatbuffersorapplication/json - 500: Internal server error
- 503: Daemon is unreachable
Properties
Property listing, retrieval, and update
GET /v1/properties/{object}
List properties on an object
Requires: X-Moor-Auth-Token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
object | path | string | Yes | Object reference in CURIE form (e.g. moor:1 or moor:system) |
inherited | query | boolean | No | Include inherited properties (default: false) |
Responses
- 200: Property listing
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 400: Invalid object CURIE
- 401: Missing or invalid auth token
- 403: The player may not read or change it. The body is a JSON error with code
permission_denied. - 404: The object, verb, or property does not exist. The body is a JSON error with code
object_not_found,verb_not_found, orproperty_not_found. - 406: Accept header does not include
application/x-flatbuffersorapplication/json - 500: Internal server error
- 503: Daemon is unreachable
GET /v1/properties/{object}/{name}
Retrieve a single property value
Requires: X-Moor-Auth-Token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
object | path | string | Yes | Object reference in CURIE form (e.g. moor:1 or moor:system) |
name | path | string | Yes | Property name |
Responses
- 200: Property value
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 400: Invalid object CURIE
- 401: Missing or invalid auth token
- 403: The player may not read or change it. The body is a JSON error with code
permission_denied. - 404: The object, verb, or property does not exist. The body is a JSON error with code
object_not_found,verb_not_found, orproperty_not_found. - 406: Accept header does not include
application/x-flatbuffersorapplication/json - 500: Internal server error
- 503: Daemon is unreachable
POST /v1/properties/{object}/{name}
Update a property value
Sets a property to a new value specified as a MOO literal in the request body (e.g. "hello", 42,
{1, 2, 3}).
Requires: X-Moor-Auth-Token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
object | path | string | Yes | Object reference in CURIE form (e.g. moor:1 or moor:system) |
name | path | string | Yes | Property name |
Request body (required)
-
Content-Type:
text/plainExample:
"new value"
Responses
- 200: Update result
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 400: Invalid object CURIE or unparseable literal
- 401: Missing or invalid auth token
- 406: Accept header does not include
application/x-flatbuffersorapplication/json - 500: Internal server error
- 503: Daemon is unreachable
Objects
Object listing and resolution
GET /v1/objects
List all objects visible to the player
Requires: X-Moor-Auth-Token
Responses
- 200: Object listing
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 401: Missing or invalid auth token
- 406: Accept header does not include
application/x-flatbuffersorapplication/json - 500: Internal server error
- 503: Daemon is unreachable
GET /v1/objects/query
Query objects with filters
Returns a list of objects matching the provided filters. Internally uses BatchWorldState with a WsQueryObjects action.
Requires: X-Moor-Auth-Token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
parent | query | string | No | Filter by direct parent (CURIE) |
location | query | string | No | Filter by container (CURIE) |
owner | query | string | No | Filter by owner (CURIE) |
flags_all | query | integer (uint16) | No | Require all of these flags (bitmask) |
flags_any | query | integer (uint16) | No | Require any of these flags (bitmask) |
Responses
- 200: Query results
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 401: Missing or invalid auth token
- 406: Accept header does not include
application/x-flatbuffersorapplication/json - 500: Internal server error
- 503: Daemon is unreachable
GET /v1/objects/{object}
Resolve an object reference
Resolves a CURIE (e.g. moor:1, moor:system) and returns object details.
Requires: X-Moor-Auth-Token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
object | path | string | Yes | Object reference in CURIE form (e.g. moor:1 or moor:system) |
Responses
- 200: Object details
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 400: Invalid object CURIE
- 401: Missing or invalid auth token
- 404: The object, verb, or property does not exist. The body is a JSON error with code
object_not_found,verb_not_found, orproperty_not_found. - 406: Accept header does not include
application/x-flatbuffersorapplication/json - 500: Internal server error
- 503: Daemon is unreachable
POST /v1/batch
Execute multiple world state operations atomically
Submits a list of world state actions to be executed in a single transaction. Supports both
FlatBuffers (BatchWorldState table) and JSON payloads. The server rejects the full request if any
action cannot be decoded; it never executes a partial batch.
Requires: X-Moor-Auth-Token
Request body (required)
-
Content-Type:
application/x-flatbuffers -
Content-Type:
application/jsonField Type Required Description actionsarray Yes rollbackboolean No
Responses
- 200: Batch execution results
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 400: Invalid request body
- 401: Missing or invalid auth token
- 403: The player may not read or change it. The body is a JSON error with code
permission_denied. - 404: The object, verb, or property does not exist. The body is a JSON error with code
object_not_found,verb_not_found, orproperty_not_found. - 406: Accept header does not include
application/x-flatbuffersorapplication/json - 500: Internal server error
- 503: Daemon is unreachable
EventLog
Encrypted event-log history and presentation management
GET /v1/history
Retrieve narrative history
Returns narrative events for the authenticated player. Exactly one of since_seconds,
since_event, or until_event must be provided.
Requires: X-Moor-Auth-Token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
since_seconds | query | integer (uint64) | No | Return events from this many seconds ago |
since_event | query | string (uuid) | No | Return events after this event ID |
until_event | query | string (uuid) | No | Return events up to this event ID |
limit | query | integer | No | Maximum number of events to return |
Responses
- 200: History events
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 400: Invalid UUID or missing query parameter
- 401: Missing or invalid auth token
- 406: Accept header does not include
application/x-flatbuffersorapplication/json - 500: Internal server error
- 503: Daemon is unreachable
GET /v1/presentations
List active presentations
Requires: X-Moor-Auth-Token
Responses
- 200: Current presentations
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 401: Missing or invalid auth token
- 406: Accept header does not include
application/x-flatbuffersorapplication/json - 500: Internal server error
- 503: Daemon is unreachable
DELETE /v1/presentations/{presentation_id}
Dismiss a presentation
Requires: X-Moor-Auth-Token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
presentation_id | path | string | Yes |
Responses
- 200: Presentation dismissed
- Content-Type:
application/json
- Content-Type:
- 401: Missing or invalid auth token
- 500: Internal server error
- 503: Daemon is unreachable
GET /v1/event-log/pubkey
Get event-log encryption public key
Requires: X-Moor-Auth-Token
Responses
- 200: Current public key
- Content-Type:
application/json
- Content-Type:
- 401: Missing or invalid auth token
- 500: Internal server error
- 503: Daemon is unreachable
PUT /v1/event-log/pubkey
Set event-log encryption public key
Requires: X-Moor-Auth-Token
Request body (required)
-
Content-Type:
application/jsonField Type Required Description public_keystring Yes age public key
Responses
- 200: Key set
- Content-Type:
application/json
- Content-Type:
- 400: Missing public_key field
- 401: Missing or invalid auth token
- 500: Internal server error
- 503: Daemon is unreachable
DELETE /v1/event-log/history
Delete event-log history for the player
Requires: X-Moor-Auth-Token
Responses
- 200: History deleted
- Content-Type:
application/json
- Content-Type:
- 401: Missing or invalid auth token
- 500: Internal server error
- 503: Daemon is unreachable
System
Health, version, features, and system properties
GET /v1/system_property/{path}
Read a system property by dotted path
Retrieves a property from $system by path (e.g. server_version). Auth token is optional —
unauthenticated requests are allowed.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | Dotted property path (catch-all) |
Responses
- 200: Property value
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 400: Invalid property path
- 403: The player may not read or change it. The body is a JSON error with code
permission_denied. - 404: The object, verb, or property does not exist. The body is a JSON error with code
object_not_found,verb_not_found, orproperty_not_found. - 406: Accept header does not include
application/x-flatbuffersorapplication/json - 500: Internal server error
- 503: Daemon is unreachable
GET /v1/features
Get server feature flags
Returns the set of features the server supports. Response is cached.
Responses
- 200: Feature flags
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 406: Accept header does not include
application/x-flatbuffersorapplication/json - 500: Internal server error
GET /v1/invoke_welcome_message
Get the server welcome message
Invokes #0:do_login_command with no arguments to produce the welcome/MOTD text shown before login.
This is the one call that needs no credentials; it always runs that one verb as #0, and its output
is captured and returned.
Responses
- 200: Welcome message
- Content-Type:
application/x-flatbuffers - Content-Type:
application/json
- Content-Type:
- 406: Accept header does not include
application/x-flatbuffersorapplication/json - 500: Internal server error
- 503: Daemon is unreachable
GET /health
Health check
Returns 200 if the web host is running and has received a daemon ping recently; 503 otherwise.
Responses
- 200: Healthy (empty body)
- 503: No recent daemon ping
GET /version
Get server version
Responses
- 200: Version info
- Content-Type:
application/json
- Content-Type:
GET /openapi.yaml
OpenAPI specification
Returns this spec (embedded at compile time).
Responses
- 200: OpenAPI 3.1.0 YAML document
- Content-Type:
text/yaml
- Content-Type:
Webhooks
External webhook receiver (forwarded to MOO)
GET /webhooks/{path}
Receive an external webhook (GET)
The web host forwards the request to the MOO #0:invoke_http_handler verb. It creates no daemon
connection state. The MOO verb determines the response status code, body, and content type.
No authentication required — the request runs as the system user. Body limit is 2 MB.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | Catch-all webhook path |
Responses
- 200: Webhook handled (status, body, and content type determined by MOO verb)
- Content-Type:
*/*
- Content-Type:
- 404: No webhook handler found
- 408: Webhook handler timed out (30 s)
- 503: Daemon is unreachable
POST /webhooks/{path}
Receive an external webhook (POST)
The web host forwards the request to the MOO #0:invoke_http_handler verb. It creates no daemon
connection state. The MOO verb determines the response status code, body, and content type.
No authentication required — the request runs as the system user. Body limit is 2 MB.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | Catch-all webhook path |
Request body
- Content-Type:
*/*
Responses
- 200: Webhook handled (status, body, and content type determined by MOO verb)
- Content-Type:
*/*
- Content-Type:
- 404: No webhook handler found
- 408: Webhook handler timed out (30 s)
- 503: Daemon is unreachable
PUT /webhooks/{path}
Receive an external webhook (PUT)
The web host forwards the request to the MOO #0:invoke_http_handler verb. It creates no daemon
connection state. The MOO verb determines the response status code, body, and content type.
No authentication required — the request runs as the system user. Body limit is 2 MB.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | Catch-all webhook path |
Request body
- Content-Type:
*/*
Responses
- 200: Webhook handled (status, body, and content type determined by MOO verb)
- Content-Type:
*/*
- Content-Type:
- 404: No webhook handler found
- 408: Webhook handler timed out (30 s)
- 503: Daemon is unreachable
DELETE /webhooks/{path}
Receive an external webhook (DELETE)
The web host forwards the request to the MOO #0:invoke_http_handler verb. It creates no daemon
connection state. The MOO verb determines the response status code, body, and content type.
No authentication required — the request runs as the system user. Body limit is 2 MB.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | Catch-all webhook path |
Responses
- 200: Webhook handled (status, body, and content type determined by MOO verb)
- Content-Type:
*/*
- Content-Type:
- 404: No webhook handler found
- 408: Webhook handler timed out (30 s)
- 503: Daemon is unreachable
PATCH /webhooks/{path}
Receive an external webhook (PATCH)
The web host forwards the request to the MOO #0:invoke_http_handler verb. It creates no daemon
connection state. The MOO verb determines the response status code, body, and content type.
No authentication required — the request runs as the system user. Body limit is 2 MB.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | Catch-all webhook path |
Request body
- Content-Type:
*/*
Responses
- 200: Webhook handled (status, body, and content type determined by MOO verb)
- Content-Type:
*/*
- Content-Type:
- 404: No webhook handler found
- 408: Webhook handler timed out (30 s)
- 503: Daemon is unreachable