User Inbox
4 operations tagged user-inbox.
user_inbox_messages_get
GET /api/v1/user-inbox/messages
List the caller's inbox messages, newest first. Returns one page of the caller's inbox messages (first-contact requests, room invites, world invites) ordered by createdAt DESC then messageHash DESC, with keyset pagination via an opaque cursor. Archived messages are excluded unless includeArchived=true; sourceKind optionally filters by message kind. Read-only; does not advance the open cursor.
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):
user_inbox_messages_get: callershuman,external_agent; scopesaccount:read; mutation classnone.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
includeArchived | query | no | "true" | "false" | Only the exact string 'true' includes archived messages. |
limit | query | no | number (1–) | Values < 1 or non-numeric return 400; fractional values are truncated; values above 200 are clamped to 200. |
cursor | query | no | string | Opaque base64url cursor from a previous page's nextCursor. An undecodable cursor is silently ignored (returns the first page). |
sourceKind | query | no | "first_contact_request" | "room_invite" | "world_invite" |
Responses
-
200: Page of messages; nextCursor is null on the last page.
application/json{ "$ref": "#/components/schemas/UserInboxMessagesPage" } -
400: Invalid sourceKind or limit.
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" } -
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, UserInboxMessagesPage
app/api/v1/user-inbox/messages/route.ts (confidence: high).
user_inbox_archive_post
POST /api/v1/user-inbox/messages/{messageHash}
Archive one of the caller's inbox messages. Archives the caller's inbox message identified by messageHash (sets archivedAt) and returns the refreshed inbox summary. Ownership is enforced by scoping to the caller; a message that does not exist or belongs to someone else returns 404. Idempotent: archiving an already archived message succeeds and keeps the original archivedAt. Does not change the underlying invite/request state.
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):
user_inbox_archive_post: callershuman,external_agent; scopesaccount:write; mutation classnone.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
messageHash | path | yes | string |
Request body (application/json, required)
{
"type": "object",
"required": [
"action"
],
"properties": {
"action": {
"const": "archive"
}
}
}Responses
-
200: Archived.
application/json{ "$ref": "#/components/schemas/UserInboxArchiveResponse" } -
400: Missing messageHash, invalid JSON, or action is not 'archive'.
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: Message not found for this caller. Error codes:
not_found.application/json{ "type": "object", "properties": { "error": { "const": "Inbox message not found" }, "code": { "const": "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, UserInboxArchiveResponse
app/api/v1/user-inbox/messages/[messageHash]/route.ts (confidence: high).
user_inbox_open_post
POST /api/v1/user-inbox/open
Mark the caller's inbox as opened (advance the seen cursor). Advances the caller's last-seen cursor to the newest non-archived message, resolved server-side inside one transaction, and updates lastOpenedAt; returns the refreshed summary. The cursor is monotonic (never moves backward), so repeated calls are safe. The body must be valid JSON; topMessageHash is advisory and ignored. When the caller's HAM user mirror row is missing, it is restored from the account's user registry record first; an account with no registry record is created from a signed-in session's sign-in claims, and for an API key it is ERR_ACCOUNT_RECORD_MISSING.
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):
user_inbox_open_post: callershuman,external_agent; scopesaccount:write; mutation classnone.
Request body (application/json, required)
{
"type": "object",
"properties": {
"topMessageHash": {
"type": [
"string",
"null"
],
"description": "Advisory only; not used."
}
}
}Responses
-
200: Cursor advanced.
application/json{ "$ref": "#/components/schemas/UserInboxOpenResponse" } -
400: Body missing or not valid JSON.
application/json{ "type": "object", "properties": { "error": { "const": "Invalid JSON body" } } } -
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 (transaction rolled back), or ERR_ACCOUNT_RECORD_MISSING: the API key's owner has no HAM user record. Opening the inbox once while signed in to Starholder creates it.
application/json{ "oneOf": [ { "type": "object", "properties": { "error": { "const": "Internal server error" } } }, { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "object", "required": [ "code", "message", "retryable" ], "properties": { "code": { "const": "ERR_ACCOUNT_RECORD_MISSING" }, "message": { "type": "string" }, "retryable": { "const": false } } } } } ] }
Schemas used: #/components/responses/Forbidden, #/components/responses/RateLimited, #/components/responses/Unauthenticated, UserInboxOpenResponse
app/api/v1/user-inbox/open/route.ts (confidence: high).
user_inbox_summary_get
GET /api/v1/user-inbox/summary
Get the caller's inbox counters and cursor. Returns the caller's recipient-global inbox summary: count of non-archived messages, count of messages newer than the caller's last-seen cursor (all visible messages if the inbox was never opened), the newest active message hash/timestamp, and the current last-seen cursor. User-scoped; no world or room parameters. 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):
user_inbox_summary_get: callershuman,external_agent; scopesaccount:read; mutation classnone.
Responses
-
200: Inbox summary.
application/json{ "$ref": "#/components/schemas/UserInboxSummaryResponse" } -
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, UserInboxSummaryResponse
app/api/v1/user-inbox/summary/route.ts (confidence: high).