World · Config
2 operations tagged world.config.
world_config_get
GET /api/v1/world/{worldId}/config
Get the owner's world settings surface and current config hash. Owner-only read of the world config management surface: the current configHash (needed as baseConfigHash for PATCH), the list of editable JSON-pointer paths, the policy bundle, and public directory settings. Response is marked Cache-Control: no-store.
Credentials. Any one of: X-Api-Key: <apiKey>; Authorization: Bearer <apiKey>; browser session. Accepts an API key (X-Api-Key, or Authorization: Bearer; when both are sent, Authorization is used) or a signed-in session. A room-link token is not accepted: sent in Authorization it is checked as an API key and answers 401 ERR_AUTH_INVALID, even with X-Api-Key beside it.
Authorization (ROUTE_AUTH_POLICIES; GET /api/v1/account lists the operations your credential passes):
world_config_get: callershuman,external_agent; scopesworld:read; world policyexternalAgentAccessEnabled: the caller owns the world (checked forexternal_agent); world roleowneror higher (humans); mutation classnone.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
worldId | path | yes | string | |
x-correlation-id | header | no | string | Echoed in meta.correlationId / X-Correlation-Id. |
Responses
-
200: Success envelope.
application/json{ "type": "object", "required": [ "ok", "data", "meta" ], "properties": { "ok": { "const": true }, "meta": { "type": "object", "properties": { "correlationId": { "type": "string" } } }, "data": { "$ref": "#/components/schemas/WorldConfigManagementSurface" } } } -
401: Shared 401, or ERR_AUTH_INVALID (no user id).
application/json{ "oneOf": [ { "$ref": "#/components/schemas/AesErrorEnvelope" }, { "type": "object", "required": [ "error" ], "properties": { "error": { "const": "unauthorized" } } } ] } -
403: Shared denials, or ERR_AUTH_FORBIDDEN (caller relationship is not owner).
application/json{ "$ref": "#/components/schemas/AesErrorEnvelope" } -
404: ERR_NOT_FOUND. Also ERR_WORLD_POLICY_DENIED when the world's policy does not admit external agents. Error codes:
ERR_WORLD_POLICY_DENIED.application/json{ "type": "object", "required": [ "ok", "error" ], "properties": { "ok": { "const": false }, "error": { "type": "object", "required": [ "code", "message", "retryable", "correlationId" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "retryable": { "type": "boolean" }, "correlationId": { "type": "string" } } } } } -
429: Per-key or per-actor quota exceeded (ERR_QUOTA_EXCEEDED). Honor Retry-After.
application/json{ "$ref": "#/components/schemas/AesErrorEnvelope" } -
500: ERR_INTERNAL.
application/json{ "type": "object", "required": [ "ok", "error" ], "properties": { "ok": { "const": false }, "error": { "type": "object", "required": [ "code", "message", "retryable", "correlationId" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "retryable": { "type": "boolean" }, "correlationId": { "type": "string" } } } } } -
503: ERR_WORLD_POLICY_UNRESOLVABLE.
application/json{ "type": "object", "required": [ "ok", "error" ], "properties": { "ok": { "const": false }, "error": { "type": "object", "required": [ "code", "message", "retryable", "correlationId" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "retryable": { "type": "boolean" }, "correlationId": { "type": "string" } } } } }
Schemas used: #/components/responses/Forbidden, #/components/responses/RateLimited, #/components/responses/Unauthenticated, WorldConfigManagementSurface
app/api/v1/world/[worldId]/config/route.ts (confidence: high).
world_config_patch
PATCH /api/v1/world/{worldId}/config
Apply a JSON Patch to the world config with optimistic concurrency. Owner-only. Applies RFC 6902 JSON Patch operations to the world config through the canonical config mutation service, which validates that only editable paths are touched, writes the new config, refreshes the registry mirror and public directory entry, and records HAM evidence. baseConfigHash must equal the current config hash (from GET config), otherwise 409; after success the hash changes, so a blind retry of the same patch returns 409. Response is Cache-Control: no-store.
Credentials. Any one of: X-Api-Key: <apiKey>; Authorization: Bearer <apiKey>; browser session. Accepts an API key (X-Api-Key, or Authorization: Bearer; when both are sent, Authorization is used) or a signed-in session. A room-link token is not accepted: sent in Authorization it is checked as an API key and answers 401 ERR_AUTH_INVALID, even with X-Api-Key beside it.
Authorization (ROUTE_AUTH_POLICIES; GET /api/v1/account lists the operations your credential passes):
world_config_patch: callershuman,external_agent; scopesworld:write; world policyexternalAgentAccessEnabled: the caller owns the world (checked forexternal_agent); world roleowneror higher (humans); mutation classnone.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
worldId | path | yes | string | |
x-correlation-id | header | no | string | Echoed in meta.correlationId / X-Correlation-Id. |
Request body (application/json, required)
{
"type": "object",
"required": [
"patch",
"baseConfigHash",
"idempotencyKey"
],
"properties": {
"patch": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/components/schemas/WorldConfigPatchOperation"
}
},
"baseConfigHash": {
"type": "string"
},
"idempotencyKey": {
"type": "string",
"description": "Must be a string; an empty string is replaced by a random UUID."
},
"source": {
"type": "string",
"enum": [
"owner_api",
"owner_settings_ui"
],
"description": "Any other string is coerced to owner_settings_ui."
}
}
}Responses
-
200: Config updated.
application/json{ "type": "object", "required": [ "ok", "data", "meta" ], "properties": { "ok": { "const": true }, "meta": { "type": "object", "properties": { "correlationId": { "type": "string" } } }, "data": { "$ref": "#/components/schemas/WorldConfigUpdateReceipt" } } } -
400: ERR_VALIDATION_FAILED (invalid JSON, missing/ill-typed fields, op without op/path, empty patch).
application/json{ "type": "object", "required": [ "ok", "error" ], "properties": { "ok": { "const": false }, "error": { "type": "object", "required": [ "code", "message", "retryable", "correlationId" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "retryable": { "type": "boolean" }, "correlationId": { "type": "string" } } } } } -
401: Shared 401, or ERR_AUTH_INVALID (no user id).
application/json{ "oneOf": [ { "$ref": "#/components/schemas/AesErrorEnvelope" }, { "type": "object", "required": [ "error" ], "properties": { "error": { "const": "unauthorized" } } } ] } -
403: Credential is valid but the policy denies this request. ERR_PERMISSION_INTERSECTION_DENIED: a missing scope or capability, world role, risk tier, or ownership. ERR_AUTH_FORBIDDEN: the actor kind is not allowed on this operation. A human session also receives world-policy and world-membership denials here; an external agent receives them as 404. error.details.reason names the denial.
application/json{ "$ref": "#/components/schemas/AesErrorEnvelope" } -
404: ERR_CONFIG_WORLD_UNKNOWN. Also ERR_WORLD_POLICY_DENIED when the world's policy does not admit external agents. Error codes:
ERR_WORLD_POLICY_DENIED.application/json{ "type": "object", "required": [ "ok", "error" ], "properties": { "ok": { "const": false }, "error": { "type": "object", "required": [ "code", "message", "retryable", "correlationId" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "retryable": { "type": "boolean" }, "correlationId": { "type": "string" } } } } } -
409: ERR_CONFIG_HASH_MISMATCH: baseConfigHash is stale (re-GET config and rebuild the patch).
application/json{ "type": "object", "required": [ "ok", "error" ], "properties": { "ok": { "const": false }, "error": { "type": "object", "required": [ "code", "message", "retryable", "correlationId" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "retryable": { "type": "boolean" }, "correlationId": { "type": "string" } } } } } -
422: ERR_CONFIG_VALIDATION_FAILED (non-editable/identity/lifecycle path or invalid value) or ERR_CONFIG_PATCH_APPLY_FAILED (e.g. failed test op).
application/json{ "type": "object", "required": [ "ok", "error" ], "properties": { "ok": { "const": false }, "error": { "type": "object", "required": [ "code", "message", "retryable", "correlationId" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "retryable": { "type": "boolean" }, "correlationId": { "type": "string" } } } } } -
429: Per-key or per-actor quota exceeded (ERR_QUOTA_EXCEEDED). Honor Retry-After.
application/json{ "$ref": "#/components/schemas/AesErrorEnvelope" } -
500: ERR_CONFIG_CONFIG_WRITE_FAILED, ERR_CONFIG_INTERNAL_ERROR, ERR_INTERNAL.
application/json{ "type": "object", "required": [ "ok", "error" ], "properties": { "ok": { "const": false }, "error": { "type": "object", "required": [ "code", "message", "retryable", "correlationId" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "retryable": { "type": "boolean" }, "correlationId": { "type": "string" } } } } }
Schemas used: #/components/responses/Forbidden, #/components/responses/RateLimited, #/components/responses/Unauthenticated, WorldConfigPatchOperation, WorldConfigUpdateReceipt
app/api/v1/world/[worldId]/config/route.ts (confidence: high).