K8 HQ

Inboxes — K8 HQ Setup API

Inboxes operations for K8 HQ Setup API. Requests, permissions and responses.

Version 1OpenAPI description (JSON)

Browse operation groups

Before making requests, read the authentication and request requirements.

Create and remove inboxes, and move addresses between them.

Base URL

Base URLFor
https://api.k8hq.com/setupThe 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

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe 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)

FieldTypeDescription
inboxId requiredstringThe inbox (ibx_...). Pattern: ^ibx_.
orgId requiredstringThe organization (org_...). Pattern: ^org_.
{"inboxId":"ibx_01J...","orgId":"org_01J..."}

Response body (JSON)

FieldTypeDescription
inboxId requiredstringThe inbox (ibx_...). Pattern: ^ibx_.

Responses

StatusBodyMeaning
200JSONKept.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
403application/problem+jsonOnly an owner can (owner_only), or not a member (forbidden).
404application/problem+jsonNo such inbox in the organization (not_found).
409application/problem+jsonIts purge has started, or it isn't being removed (removal_started).
503application/problem+jsonA temporary problem (unavailable); retry.

Move an address to a new inbox

POST/v1/inboxes/promote

Creates an inbox named name in the organization and moves one of an inbox's addresses into it as its first address (Settings > Organization > Inboxes > Edit, "Move to a new inbox…"). No mail to the address is refused at any point: until the move, mail arrives where it did; from then on, in the new inbox, which also sends as the address. Mail already received stays in the old inbox. The person gets access to the new inbox as its owner, as with Create an inbox; nobody else does until someone gives them access.

It happens in steps: the new inbox is made empty, the person's access is given, then the address moves in one step. If the move fails (the address changed meanwhile, say), the answer is 409 address_not_moved with the new, empty inbox's inboxId: the address still receives where it was. Move it there with the Content API's move, or remove the empty inbox.

Needs what creating an inbox needs (containers.create, inbox.addresses.manage and domains.manage), plus inbox.addresses.manage on the inbox the address leaves, which the person is in. Not for a catch-all address, the DMARC reports inbox, a personal notice inbox, or an inbox readable only with its members' own keys.

Needs a passkey confirmation of this change (x-k8hq-confirm: inbox.promote). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.

Parameters

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe 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)

FieldTypeDescription
endpointId requiredstringThe address to move (ept_...), as the Content API lists an inbox's addresses. Pattern: ^ept_.
inboxId requiredstringThe inbox the address is on now (ibx_...). Pattern: ^ibx_.
name requiredstringThe new inbox's name, 1 to 100 characters, which everyone in it sees.
orgId requiredstringThe organization (org_...). Pattern: ^org_.
{"endpointId":"ept_01J...","inboxId":"ibx_01J...","name":"Support","orgId":"org_01J..."}

Response body (JSON)

FieldTypeDescription
endpointId requiredstringThe address that moved (ept_...): its ID stays the same. Pattern: ^ept_.
inboxId requiredstringThe new inbox (ibx_...). Pattern: ^ibx_.

Responses

StatusBodyMeaning
200JSONThe new inbox, with the address on it.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo 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).
402application/problem+jsonThe 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).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
404application/problem+jsonNo such inbox in the organization, or the person isn't in it (not_found).
409application/problem+jsonThe address's domain isn't verified (domain_unverified); the address isn't in the inbox any more (conflict); the inbox's addresses are K8 HQ's to set up, or it's readable only with its members' own keys (inbox_kept); or the new inbox was made but the address didn't move (address_not_moved, with its inboxId).
410application/problem+jsonThe organization is being deleted (org_closed).
503application/problem+jsonA 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)

FieldTypeDescription
inboxId requiredstringPattern: ^ibx_.
orgId requiredstringPattern: ^org_.
schemaVersion required1
afterHeadstringBase64 holder-chain head already held by the client.

Response body (JSON)

FieldTypeDescription
encryption requiredZeroAccessEncryption
inboxId requiredstring
mode requiredcompatible | marked | switching | zero-access
orgId requiredstring
schemaVersion required1

Responses

StatusBodyMeaning
200JSONThe inbox's current encryption status, with signed records for the client to verify.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
409application/problem+jsonThe status is too large to return (conflict).
503application/problem+jsonA 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

NameTypeDescription
orgId (path) requiredstringorgId resource identifier.

Response body (JSON)

FieldTypeDescription
inboxes requiredobject[]

Responses

StatusBodyMeaning
200JSONThe organization's inboxes.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
503application/problem+jsonA 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

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe 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) requiredstringOrganization ID.
Idempotency-Key (header)stringRequired 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)

FieldTypeDescription
Alternative 1SessionCreateInboxResourceInputSessionCreateInboxResourceInput
Alternative 2AgentInboxInputAgentInboxInput
{"addresses":["hello@example.com","dee@example.com"]}

Response body (JSON)

FieldTypeDescription
Alternative 1SessionCreateInboxResourceResultSessionCreateInboxResourceResult
Alternative 2AgentInboxResultAgentInboxResult

Responses

StatusBodyMeaning
200JSONThe new inbox.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo 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).
402application/problem+jsonThe 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).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
404application/problem+jsonThe organization is outside this connection, or the target does not exist.
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonA 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).
410application/problem+jsonCurrent resource state prevents this change. Branch on the stable code.
422application/problem+jsonThe 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.
503application/problem+jsonA 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

NameTypeDescription
orgId (path) requiredstringorgId resource identifier.

Response body (JSON)

FieldTypeDescription
removals requiredobject[]

Responses

StatusBodyMeaning
200JSONWaiting removals.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
503application/problem+jsonA 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

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe 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) requiredstringorgId resource identifier.
inboxId (path) requiredstringinboxId resource identifier.
x-k8hq-delete-confirm (header)stringExact 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)stringRequired 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)

FieldTypeDescription
Alternative 1SessionDeleteInboxResourceInputSessionDeleteInboxResourceInput
Alternative 2AgentConfirmationInputAgentConfirmationInput
{"confirm":"hello@example.com"}

Response body (JSON)

FieldTypeDescription
Alternative 1SessionDeleteInboxResourceResultSessionDeleteInboxResourceResult
Alternative 2AgentRemovalReceiptAgentRemovalReceipt

Responses

StatusBodyMeaning
200JSONClosed; its purge is scheduled.
400application/problem+jsonThe typed confirmation doesn't match (confirm_name), or invalid input (invalid).
401application/problem+jsonNo 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).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
404application/problem+jsonNo such inbox in the organization (not_found).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonIt's a member's personal notice inbox or the DMARC reports inbox, which aren't removed this way (inbox_kept).
410application/problem+jsonThe organization is being deleted (org_closed).
429application/problem+jsonThe organization removed 10 inboxes and domains today (removal_limit).
503application/problem+jsonA temporary problem (unavailable); retry.