Inboxes — K8 HQ Setup API
Inboxes operations for K8 HQ Setup API. Requests, permissions and responses.
Version 1OpenAPI description (JSON)
Before making requests, read the authentication and request requirements.
Create and remove inboxes, and move addresses between them.
Base URL
| Base URL | For |
https://api.k8hq.com/setup | The K8 HQ web app, and programs acting with a person's session |
Endpoints
Inboxes
Keep an inbox
POST/v1/inboxes/delete/cancel
Keeps an inbox whose removal hasn't purged it yet: any owner, no passkey (like cancelling an organization's deletion). It opens again as it was: its mail, addresses, everyone's access and mail apps' tokens, and the rules its removal paused. The owners and its members are told.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.
Parameters
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). |
Request body (JSON)
| Field | Type | Description |
inboxId required | string | The inbox (ibx_...). Pattern: ^ibx_. |
orgId required | string | The organization (org_...). Pattern: ^org_. |
{"inboxId":"ibx_01J...","orgId":"org_01J..."}
Response body (JSON)
| Field | Type | Description |
inboxId required | string | The inbox (ibx_...). Pattern: ^ibx_. |
Responses
| Status | Body | Meaning |
| 200 | JSON | Kept. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No session, it expired, or it isn't a person's own session (unauthenticated). |
| 403 | application/problem+json | Only an owner can (owner_only), or not a member (forbidden). |
| 404 | application/problem+json | No such inbox in the organization (not_found). |
| 409 | application/problem+json | Its purge has started, or it isn't being removed (removal_started). |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
Read an inbox's encryption status
POST/v1/inboxes/zero-access/status
Read the inbox's zero-access switch, signed holder records and encryption progress. Requires a person's current organization membership and inbox access, with no passkey confirmation. This read stays available when new zero-access changes are turned off. Pending text names a removed person, an agent you disconnected, or both. K8 HQ keeps accepting new mail while encryption waits for an authorized device. Before switching, send or cancel stored outgoing mail. The switch preflight reports scheduled_messages with count and detail when any remain; this includes short Undo holds and retained failed or uncertain sends.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.
Request body (JSON)
| Field | Type | Description |
inboxId required | string | Pattern: ^ibx_. |
orgId required | string | Pattern: ^org_. |
schemaVersion required | 1 | |
afterHead | string | Base64 holder-chain head already held by the client. |
Response body (JSON)
| Field | Type | Description |
encryption required | ZeroAccessEncryption | |
inboxId required | string | |
mode required | compatible | marked | switching | zero-access | |
orgId required | string | |
schemaVersion required | 1 | |
Responses
| Status | Body | Meaning |
| 200 | JSON | The inbox's current encryption status, with signed records for the client to verify. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No session, it expired, or it isn't a person's own session (unauthenticated). |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 409 | application/problem+json | The status is too large to return (conflict). |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
List the organization's inboxes
GET/v1/organizations/{orgId}/inboxes
The organization's inboxes (not personal notice inboxes, nor ones being removed), whether or not you're in them, with their addresses and whether you can open each one's mail; for members with containers.delete (owners and admins). It never shows mail, nor who else is in an inbox.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.
Parameters
| Name | Type | Description |
orgId (path) required | string | orgId resource identifier. |
Response body (JSON)
| Field | Type | Description |
inboxes required | object[] | |
Responses
| Status | Body | Meaning |
| 200 | JSON | The organization's inboxes. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No session, it expired, or it isn't a person's own session (unauthenticated). |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
Create an inbox
POST/v1/organizations/{orgId}/inboxes
Creates an inbox and gives the person access to it as its owner: with 1 to 10 addresses on the organization's verified domains (local parts may have letters, digits and . _ + -; catch-all addresses aren't made here), which needs containers.create, inbox.addresses.manage and domains.manage; or with no addresses and a name, which needs only containers.create (no domain needed; addresses can be added later). Then read and send through the Content API.
With addresses, needs a passkey confirmation of this change (x-k8hq-confirm: inbox.create). Until confirmations are enforced, a passkey sign-in in the last five minutes also works. With no addresses, needs a passkey sign-in in the last five minutes.
Personal agent contract (conditional). Create an inbox with one to ten distinct ordinary email addresses. This variant does not accept a name or an addressless inbox. The server chooses the inbox ID and commits initial creator access with creation. Required header: Idempotency-Key (16 to 128 visible ASCII characters). Success returns operation-id; keep the same key and input to retry. Current access is checked again on every retry. The service requires explicit operator activation. Action setup.createInboxResource. Permissions: containers.create, inbox.addresses.manage, domains.manage. Unattended-risk acknowledgment: required. Receipt: atomic-inbox-create-v1. Status fields: id, action, state, resources.organizationId, resources.inboxId. Agent input: AgentInboxInput. Agent result: AgentInboxResult.
For a person's own session (x-k8hq-token), or personal agent credentials (Authorization: Bearer) when enabled. The session needs a recent passkey: if its last passkey confirmation is more than 5 minutes old, the answer is 401 step_up_required.
Parameters
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). |
orgId (path) required | string | Organization ID. |
Idempotency-Key (header) | string | Required for personal agent credentials: 16 to 128 visible ASCII characters. A session does not need this header. Keep the exact key and input when retrying after an unknown reply. |
Request body (JSON)
{"addresses":["hello@example.com","dee@example.com"]}
Response body (JSON)
Responses
| Status | Body | Meaning |
| 200 | JSON | The new inbox. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No session or it expired (unauthenticated), or confirm this change with your passkey (confirmation_required; until confirmations are enforced, step_up_required with action, which a passkey use in the last 5 minutes also satisfies): the answer carries the action to confirm (see the sign-in API's confirmations). |
| 402 | application/problem+json | The organization has been out of credit for more than a week (no_credit, design note 0024): domains and inboxes can't be added until an owner adds credit. Removing them still works. From 60 days it's read-only (read_only). |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 404 | application/problem+json | The organization is outside this connection, or the target does not exist. |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | A domain isn't verified (domain_unverified), or an address is in use (address_taken), or one was freed in the last 7 days and only an owner may reuse it (address_reserved). |
| 410 | application/problem+json | Current resource state prevents this change. Branch on the stable code. |
| 422 | application/problem+json | The command does not meet the action limits or current requirements. The existing generic failure helper may return unavailable at this status; use the HTTP status as well. |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
List inbox removals
GET/v1/organizations/{orgId}/inboxes/removals
The organization's inboxes waiting for their purge, which an owner can still keep; for members with containers.delete (owners and admins).
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.
Parameters
| Name | Type | Description |
orgId (path) required | string | orgId resource identifier. |
Response body (JSON)
| Field | Type | Description |
removals required | object[] | |
Responses
| Status | Body | Meaning |
| 200 | JSON | Waiting removals. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No session, it expired, or it isn't a person's own session (unauthenticated). |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
Remove an inbox
DELETE/v1/organizations/{orgId}/inboxes/{inboxId}
Removes an inbox, for members with containers.delete (owners and admins), typing its name or one of its addresses (or the label you see it by) to confirm. It's closed at once: its addresses refuse mail exactly like addresses that don't exist, nothing is stored in it or sent from it, nobody can open it (mail apps' tokens for it stop working), and rules acting only on it are paused. Its content (mail, folders, forwards, settings, keys, everyone's access) is deleted for good at purgeAt, 7 days later, or within minutes if it holds no mail; until then any owner can keep it (Keep an inbox). Then its addresses stay reserved to the organization: for 7 days only an owner can put one on another inbox. The owners and its members are told. Copies of deleted mail in backups can't be read and are gone after about 6 weeks. Members' personal notice inboxes and the DMARC reports inbox aren't removed this way (inbox_kept). An organization removes at most 10 inboxes and domains a day (removal_limit). Bound to the action by per-action confirmation (inbox.delete) once that exists; a recent passkey until then.
Needs a passkey confirmation of this change (x-k8hq-confirm: container.delete). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.
Personal agent contract (conditional). Schedule removal of the exact inbox. The committed receipt is scheduling acceptance, not current pending state or purge completion. The system continues after app disconnection; the existing human cancellation path remains available during the grace period. Required header: Idempotency-Key (16 to 128 visible ASCII characters). Success returns operation-id; keep the same key and input to retry. Current access is checked again on every retry. The service requires explicit operator activation. Action setup.deleteInboxResource. Permissions: containers.delete. Unattended-risk acknowledgment: required. Receipt: inbox-removal-v1. Status fields: id, action, state, resources.inboxId. Agent input: AgentConfirmationInput. Agent result: AgentRemovalReceipt.
For a person's own session (x-k8hq-token), or personal agent credentials (Authorization: Bearer) when enabled.
Parameters
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). |
orgId (path) required | string | orgId resource identifier. |
inboxId (path) required | string | inboxId resource identifier. |
x-k8hq-delete-confirm (header) | string | Exact typed confirmation, UTF-8 percent-encoded (encodeURIComponent), decoded once; maximum 4096 encoded bytes. Use a bodyless DELETE. Input metadata, not authorization. Do not combine deletion headers with any body. JSON bodies remain supported for direct requests. |
Idempotency-Key (header) | string | Required for personal agent credentials: 16 to 128 visible ASCII characters. A session does not need this header. Keep the exact key and input when retrying after an unknown reply. |
Request body (JSON)
{"confirm":"hello@example.com"}
Response body (JSON)
Responses
| Status | Body | Meaning |
| 200 | JSON | Closed; its purge is scheduled. |
| 400 | application/problem+json | The typed confirmation doesn't match (confirm_name), or invalid input (invalid). |
| 401 | application/problem+json | No session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (step_up_required). |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 404 | application/problem+json | No such inbox in the organization (not_found). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | It's a member's personal notice inbox or the DMARC reports inbox, which aren't removed this way (inbox_kept). |
| 410 | application/problem+json | The organization is being deleted (org_closed). |
| 429 | application/problem+json | The organization removed 10 inboxes and domains today (removal_limit). |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |