Starholder API
Operation Reference

World · Default Context

1 operation tagged world.default-context.

world_default_context_get

GET /api/v1/world/default-context

Get the caller's default ('main') world context. Returns the caller's own default world (the world named 'main' they own) as a management row with relationship, read/publish capability, visibility and lifecycle, plus its worldId and handle. Intended for post-signup and shell bootstrap. Read-only.

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_default_context_get: callers human, external_agent; scopes world:read; mutation class none.

Responses

  • 200: Default world context.

    application/json

    {
      "type": "object",
      "required": [
        "defaultWorld",
        "worldId",
        "worldHandle"
      ],
      "properties": {
        "defaultWorld": {
          "$ref": "#/components/schemas/WorldManagementRow"
        },
        "worldId": {
          "type": "string"
        },
        "worldHandle": {
          "type": "string"
        }
      }
    }
  • 401: Also returned by the handler when the identity has 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: Default world not provisioned (no 'main' row or registry record missing). Error codes: default_world_not_found.

    application/json

    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "code": {
          "const": "default_world_not_found"
        }
      }
    }
  • 429: Per-key or per-actor quota exceeded (ERR_QUOTA_EXCEEDED). Honor Retry-After.

    application/json

    {
      "$ref": "#/components/schemas/AesErrorEnvelope"
    }
  • 500: Internal error.

    application/json

    {
      "type": "object",
      "properties": {
        "error": {
          "const": "Internal server error"
        }
      }
    }
  • 503: Default world policy could not be resolved. Error codes: default_world_policy_unresolvable.

    application/json

    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "code": {
          "const": "default_world_policy_unresolvable"
        },
        "worldId": {
          "type": "string"
        }
      }
    }

Schemas used: #/components/responses/Forbidden, #/components/responses/RateLimited, #/components/responses/Unauthenticated, WorldManagementRow

Contract authored from app/api/v1/world/default-context/route.ts (confidence: high).