World · Memberships
3 operations tagged world.memberships.
world_memberships_get
GET /api/v1/world/memberships
List world memberships (a world's collaborators or your own). With worldId, returns the active collaborators of that world (oldest first) and requires the caller to own it. Without worldId, returns all of the caller's own memberships in every status (active, revoked, left), newest first. Each row includes username and displayName. 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_memberships_get: callershuman,external_agent; scopesworld:read; mutation classnone.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
worldId | query | no | string | When present, owner-only collaborator listing for that world. |
Responses
-
200: Memberships.
application/json{ "type": "object", "required": [ "memberships" ], "properties": { "memberships": { "type": "array", "items": { "$ref": "#/components/schemas/WorldMembershipRow" } } } } -
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: worldId given and caller is not its owner.
application/json{ "$ref": "#/components/schemas/AesErrorEnvelope" } -
404: worldId given and world not found. Error codes:
world_not_found.application/json{ "type": "object", "properties": { "error": { "const": "World not found" }, "code": { "const": "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" } } }
Schemas used: #/components/responses/Forbidden, #/components/responses/RateLimited, #/components/responses/Unauthenticated, WorldMembershipRow
app/api/v1/world/memberships/route.ts (confidence: high).
world_membership_revoke_delete
DELETE /api/v1/world/memberships
Revoke a collaborator's membership in a world you own. Revokes another user's active membership in a world the caller owns (status revoked, endReason revoked). worldId and userId are sent in a JSON request body on the DELETE. Not idempotent: a repeat call returns 404 membership_not_found.
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_membership_revoke_delete: callershuman,external_agent; scopesworld:write; mutation classnone.
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
| Name | In | Required | Type | Description |
|---|---|---|---|---|
X-Starholder-Confirmation | header | no | string | The 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": [
"worldId",
"userId"
],
"properties": {
"worldId": {
"type": "string",
"minLength": 1
},
"userId": {
"type": "string",
"minLength": 1,
"description": "Member to revoke."
},
"reason": {
"type": [
"string",
"null"
],
"description": "Declared by RevokeWorldMembershipRequest but ignored by the handler."
}
}
}Responses
-
200: Revoked.
application/json{ "type": "object", "required": [ "status" ], "properties": { "status": { "const": "revoked" } } } -
400: Invalid JSON or missing worldId/userId.
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: Caller is not the world owner.
application/json{ "$ref": "#/components/schemas/AesErrorEnvelope" } -
404: World not found, or no active membership for that user. Error codes:
world_not_found,membership_not_found.application/json{ "type": "object", "properties": { "error": { "type": "string" }, "code": { "type": "string", "enum": [ "world_not_found", "membership_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
app/api/v1/world/memberships/route.ts (confidence: high).
world_membership_leave_post
POST /api/v1/world/memberships/leave
Leave a world you are a member of. Ends the caller's active membership in the given world (status left, endReason left). World owners have no membership row, so this does not apply to owned worlds. Not idempotent: once left, a repeat 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_membership_leave_post: callershuman,external_agent; scopesworld:write; mutation classnone.
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
| Name | In | Required | Type | Description |
|---|---|---|---|---|
X-Starholder-Confirmation | header | no | string | The 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": [
"worldId"
],
"properties": {
"worldId": {
"type": "string",
"minLength": 1
},
"reason": {
"type": [
"string",
"null"
],
"description": "Declared by LeaveWorldRequest but ignored by the handler."
}
}
}Responses
-
200: Left.
application/json{ "type": "object", "required": [ "status" ], "properties": { "status": { "const": "left" } } } -
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: 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 active membership. Error codes:
membership_not_found.application/json{ "type": "object", "properties": { "error": { "const": "Active membership not found" }, "code": { "const": "membership_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
app/api/v1/world/memberships/leave/route.ts (confidence: high).