Starholder API
Operation Reference

World · Identity

1 operation tagged world.identity.

world_identity_patch

PATCH /api/v1/world/{worldId}/identity

Update a world's display name, description, or persona title. Owner-only partial update of identity fields on the world registry record; the world slug and handle never change. Only keys present in the body are changed: displayName null or blank resets to the world name, description null clears it, worldPersonaTitle must be one of the allowed titles or null to clear. If nothing would change, the call succeeds without writing (directoryDisposition 'unchanged'), so repeats are safe.

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_identity_patch: callers human, external_agent; scopes world:write; world policy externalAgentAccessEnabled: the caller owns the world (checked for external_agent); world role owner or higher (humans); mutation class none.

Parameters

NameInRequiredTypeDescription
worldIdpathyesstring
x-correlation-idheadernostringEchoed in meta.correlationId / X-Correlation-Id.

Request body (application/json, required)

{
  "type": "object",
  "minProperties": 1,
  "anyOf": [
    {
      "required": [
        "displayName"
      ]
    },
    {
      "required": [
        "description"
      ]
    },
    {
      "required": [
        "worldPersonaTitle"
      ]
    }
  ],
  "properties": {
    "displayName": {
      "type": [
        "string",
        "null"
      ],
      "description": "Trimmed; null or blank resets to the world name."
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Trimmed; null clears."
    },
    "worldPersonaTitle": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "Narrator",
            "Keeper",
            "Curator",
            "Steward",
            "Bard",
            "Jester"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "Trimmed then must match exactly; empty string is rejected (use null to clear)."
    }
  }
}

Responses

  • 200: Identity updated (or unchanged). Cache-Control: no-store.

    application/json

    {
      "type": "object",
      "required": [
        "ok",
        "data",
        "meta"
      ],
      "properties": {
        "ok": {
          "const": true
        },
        "meta": {
          "type": "object",
          "properties": {
            "correlationId": {
              "type": "string"
            }
          }
        },
        "data": {
          "type": "object",
          "required": [
            "worldId",
            "worldRef",
            "registryRef",
            "displayName",
            "description",
            "worldPersonaTitle",
            "mirrorSynced",
            "directoryDisposition"
          ],
          "properties": {
            "worldId": {
              "type": "string"
            },
            "worldRef": {
              "type": "string",
              "description": "@owner/worldName"
            },
            "registryRef": {
              "type": "string"
            },
            "displayName": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "worldPersonaTitle": {
              "type": [
                "string",
                "null"
              ]
            },
            "mirrorSynced": {
              "type": "boolean"
            },
            "directoryDisposition": {
              "type": "string",
              "enum": [
                "updated",
                "removed",
                "unchanged",
                "sync_failed"
              ]
            }
          }
        }
      }
    }
  • 400: ERR_VALIDATION_FAILED (invalid JSON, no recognized key, wrong type, unknown persona title).

    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: Shared denials, or ERR_WORLD_IDENTITY_CAPABILITY_DENIED (not the owner).

    application/json

    {
      "$ref": "#/components/schemas/AesErrorEnvelope"
    }
  • 404: ERR_WORLD_IDENTITY_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"
            }
          }
        }
      }
    }
  • 429: Per-key or per-actor quota exceeded (ERR_QUOTA_EXCEEDED). Honor Retry-After.

    application/json

    {
      "$ref": "#/components/schemas/AesErrorEnvelope"
    }
  • 500: ERR_WORLD_IDENTITY_REGISTRY_WRITE_FAILED, ERR_WORLD_IDENTITY_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

Contract authored from app/api/v1/world/[worldId]/identity/route.ts (confidence: high).