Starholder API
Operation Reference

World · Bookmarks

3 operations tagged world.bookmarks.

world_bookmarks_get

GET /api/v1/world/bookmarks

List the caller's world bookmarks. Returns all of the caller's world bookmarks, newest first, from the Postgres bookmark mirror. A bookmark is only a pointer and confers no access to the world. 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_bookmarks_get: callers human, external_agent; scopes world:read; mutation class none.

Responses

  • 200: Bookmarks.

    application/json

    {
      "type": "object",
      "required": [
        "bookmarks"
      ],
      "properties": {
        "bookmarks": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/WorldBookmark"
          }
        }
      }
    }
  • 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"
    }
  • 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"
        }
      }
    }

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

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

world_bookmarks_post

POST /api/v1/world/bookmarks

Bookmark a world. Adds a bookmark for a world the caller can currently read or has a pending invite to. Writes the canonical bookmark JSON to storage, mirrors it in Postgres, and upserts a rebuildable graph edge. Idempotent: if the caller already bookmarked the world, returns 200 with the existing bookmarkId and code already_bookmarked.

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

Request body (application/json, required)

{
  "type": "object",
  "required": [
    "worldId"
  ],
  "properties": {
    "worldId": {
      "type": "string",
      "minLength": 1,
      "description": "Trimmed; must be a string (a non-string value causes a 500)."
    }
  }
}

Responses

  • 200: Already bookmarked.

    application/json

    {
      "type": "object",
      "required": [
        "bookmarkId",
        "worldId",
        "code"
      ],
      "properties": {
        "bookmarkId": {
          "type": "string"
        },
        "worldId": {
          "type": "string"
        },
        "code": {
          "const": "already_bookmarked"
        }
      }
    }
  • 201: Bookmark created.

    application/json

    {
      "$ref": "#/components/schemas/AddWorldBookmarkResponse"
    }
  • 400: Invalid JSON or missing worldId.

    application/json

    {
      "type": "object",
      "properties": {
        "error": {
          "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: World not readable by the caller and no pending invite.

    application/json

    {
      "$ref": "#/components/schemas/AesErrorEnvelope"
    }
  • 404: Caller has no ham_users record.

    application/json

    {
      "type": "object",
      "properties": {
        "error": {
          "const": "User 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"
        }
      }
    }

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

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

world_bookmarks_delete

DELETE /api/v1/world/bookmarks

Remove a world bookmark. Removes one of the caller's bookmarks by bookmarkId, deleting the stored bookmark JSON, the Postgres mirror row, and the graph edge. The bookmarkId is sent in a JSON request body on the DELETE. Not idempotent: a second call returns 404.

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

Confirmation. This operation deletes data. For every request, the first request changes nothing and answers 428 with what it would remove; resending the identical request with X-Starholder-Confirmation: <confirmationId> within 5 minutes runs it once. See Delete confirmation.

Parameters

NameInRequiredTypeDescription
X-Starholder-ConfirmationheadernostringThe confirmationId from this operation's 428 response. Send it with the otherwise identical request to execute that request once.

Request body (application/json, required)

{
  "type": "object",
  "required": [
    "bookmarkId"
  ],
  "properties": {
    "bookmarkId": {
      "type": "string",
      "minLength": 1
    }
  }
}

Responses

  • 200: Removed.

    application/json

    {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "const": "removed"
        }
      }
    }
  • 400: Invalid JSON or missing bookmarkId.

    application/json

    {
      "type": "object",
      "properties": {
        "error": {
          "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: No bookmark with that id for the caller. Error codes: bookmark_not_found.

    application/json

    {
      "type": "object",
      "properties": {
        "error": {
          "const": "Bookmark not found"
        },
        "code": {
          "const": "bookmark_not_found"
        }
      }
    }
  • 428: The request deletes data and nothing was changed. ERR_CONFIRMATION_REQUIRED: X-Starholder-Confirmation was not sent. ERR_CONFIRMATION_INVALID, ERR_CONFIRMATION_EXPIRED or ERR_CONFIRMATION_USED: the confirmation sent does not match this caller, operation and request, has expired, or was already used; the response carries a fresh one. confirmation.impact states what the request removes. To proceed, send confirmation.confirm (the same method, path and body) with its X-Starholder-Confirmation header before confirmation.expiresAt; it executes once.

    application/json

    {
      "$ref": "#/components/schemas/ConfirmationChallenge"
    }
  • 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: ERR_CONFIRMATION_UNAVAILABLE: the server cannot record that a confirmation was used, so the delete did not run. Retryable.

    application/json

    {
      "$ref": "#/components/schemas/AesErrorEnvelope"
    }

Schemas used: #/components/responses/ConfirmationRequired, #/components/responses/ConfirmationUnavailable, #/components/responses/Forbidden, #/components/responses/RateLimited, #/components/responses/Unauthenticated

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