Inboxes — K8 HQ Content API
Inboxes operations for K8 HQ Content API. Requests, permissions and responses.
Version 1OpenAPI description (JSON)
Before making requests, read the authentication and request requirements.
List and read your inboxes, rename them and change their settings, and get the keys to open their mail.
Base URL
| Base URL | For |
https://api.k8hq.com/v1 | API tokens and the K8 HQ web app |
Endpoints
Inboxes
List your inboxes
GET/inboxes
Your containers of kind inbox.
For API tokens with messages:read and the web app.
Response body (JSON)
| Field | Type | Description |
inboxes required | Container[] | |
Responses
| Status | Body | Meaning |
| 200 | JSON | Your inboxes. |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Get an inbox
GET/inboxes/{inbox}
The inbox, your role, its privacy, and the current epoch public key that outgoing messages are sealed to.
For API tokens with messages:read and the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
Responses
| Status | Body | Meaning |
| 200 | Inbox | The inbox. |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Get the inbox's keys
GET/inboxes/{inbox}/keys
Every epoch key of the inbox, each sealed to your user key, which you set up in the web app. Messages name the epoch they were encrypted under (keyEpoch).
For API tokens with messages:read and the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
x-k8hq-key-sha256 (header) | string | The SHA-256 (hex) of your X25519 public key, as your device computes it from the private key it unlocked. The first time keys are sealed to you, K8 HQ's mail servers pin the directory's key only if it matches (sent by a device that has unlocked the key); afterwards they seal only to the pinned key. A value that doesn't match is refused (key_changed). Older clients that omit the header are still accepted; the key is pinned when a device confirms it. |
Response body (JSON)
| Field | Type | Description |
epochs required | object[] | |
Responses
| Status | Body | Meaning |
| 200 | JSON | The sealed epoch keys. |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | You haven't set up your encryption key yet; or the directory's key for you isn't the one pinned at the first seal (key_changed): nothing is sealed to it; or first-pin enforcement is enabled, no key is pinned yet and no device vouched for it (key_unverified). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Rename an inbox
PUT/inboxes/{inbox}/name
The inbox's name, the one everyone in it sees in the web app and the API (label) instead of its first address. 1 to 100 characters without control characters (spaces are collapsed); null or "" removes it, so people see its first address again. Not for personal notice inboxes (400). The organization's owners and admins (inbox.settings.change), signed in to the web app with a passkey used in the last 5 minutes (401 step_up_required otherwise). Each change is recorded (inbox.renamed); the name itself stays out of events.
For the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Request body (JSON)
| Field | Type | Description |
name required | string | null | |
{"name":"Support"}
Response body (JSON)
| Field | Type | Description |
id required | string | The inbox (ibx_...). |
label required | string | What people see it called: the name, or their grant's label (its first address). |
name required | string | Its name; "" for none. |
Responses
| Status | Body | Meaning |
| 200 | JSON | The inbox's name, and what people see it called. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 402 | application/problem+json | The organization is read-only (read_only, design note 0024): it has been out of credit for 60 days, so nothing can be changed until an owner adds credit. |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | A request with this Idempotency-Key is still running (in_progress). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Get the inbox's settings
GET/inboxes/{inbox}/settings
Who may do what with the inbox: rules sending mail, forwarding, and members managing rules; and whether mail in Trash and Spam is deleted after 30 days. Everyone with access to the inbox sees them. Also shows K8 Messages consent, its revision and whether this person may turn it on or off. The explicit array includes k8MayRead only after someone sets it.
For API tokens with messages:read and the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
Response body (JSON)
| Field | Type | Description |
explicit required | string[] | The settings someone set. rulesMaySend and forwardingOff left unset follow the inbox: allowed while one member has access, off once it's shared. |
forwardingOff required | boolean | Members may not forward this inbox; no forward runs. Off by default. Unset, it follows the inbox: allowed while one member has access, off once it's shared. |
k8MayRead required | boolean | K8 Messages may read this inbox; absent consent means false, with no inherited default. |
k8MayReadRevision required | integer | |
mayChange required | boolean | Whether the caller may change these (inbox.settings.change for this inbox, signed in to the web app; never a personal notice inbox's). |
mayDisableK8 required | boolean | |
mayEnableK8 required | boolean | |
memberRulesOff required | boolean | Only the organization's owners and admins create, change, pause, delete and test rules acting on this inbox. Off by default: members with access may. |
rulesMaySend required | boolean | Rules may send mail out of K8 HQ from this inbox (automatic replies). Off by default. Unset, it follows the inbox: allowed while one member has access, off once it's shared. |
spamAutoDelete required | boolean | Messages in Spam longer than 30 days are deleted for good, once a day; flagged ones are kept. On by default; turning it back on restarts the 30 days. |
trashAutoDelete required | boolean | Messages in Trash longer than 30 days are deleted for good, once a day; flagged ones are kept. On by default; turning it back on restarts the 30 days. |
Responses
| Status | Body | Meaning |
| 200 | InboxSettings | The inbox's settings. |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Change the inbox's settings
PATCH/inboxes/{inbox}/settings
The organization's owners and admins, signed in to the web app with a passkey used in the last 5 minutes (401 step_up_required otherwise). Each change is recorded (inbox.setting_changed). Needs a passkey confirmation of exactly this change (x-k8hq-confirm: inbox.setting, design note 0013): send x-k8hq-confirm with it. A dedicated {"k8MayRead":true|false} patch (at most 4 KiB, never mixed with other settings) changes K8 Messages consent. Someone who can edit the inbox and manage its settings, or its only member, if they can edit it, can turn it on. An owner must first allow K8 Messages for the organization. The inbox must support K8 Messages. You confirm the change once with a passkey within five minutes. The confirmation binds who can turn it on and the inbox's current consent, including whether it was set before. Turning it off is a veto by any unsuspended member with access, without a recent passkey, even when K8 or its flags are off. Repeated values do nothing. Changes atomically record inbox.ai_read.enabled or inbox.ai_read.disabled and notify everyone with access and current owners in their personal notice inboxes. API tokens, apps and assistants receive needs_person. Responses use Cache-Control: no-store.
For the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Response body (JSON)
| Field | Type | Description |
explicit required | string[] | The settings someone set. rulesMaySend and forwardingOff left unset follow the inbox: allowed while one member has access, off once it's shared. |
forwardingOff required | boolean | Members may not forward this inbox; no forward runs. Off by default. Unset, it follows the inbox: allowed while one member has access, off once it's shared. |
k8MayRead required | boolean | K8 Messages may read this inbox; absent consent means false, with no inherited default. |
k8MayReadRevision required | integer | |
mayChange required | boolean | Whether the caller may change these (inbox.settings.change for this inbox, signed in to the web app; never a personal notice inbox's). |
mayDisableK8 required | boolean | |
mayEnableK8 required | boolean | |
memberRulesOff required | boolean | Only the organization's owners and admins create, change, pause, delete and test rules acting on this inbox. Off by default: members with access may. |
rulesMaySend required | boolean | Rules may send mail out of K8 HQ from this inbox (automatic replies). Off by default. Unset, it follows the inbox: allowed while one member has access, off once it's shared. |
spamAutoDelete required | boolean | Messages in Spam longer than 30 days are deleted for good, once a day; flagged ones are kept. On by default; turning it back on restarts the 30 days. |
trashAutoDelete required | boolean | Messages in Trash longer than 30 days are deleted for good, once a day; flagged ones are kept. On by default; turning it back on restarts the 30 days. |
Responses
| Status | Body | Meaning |
| 200 | InboxSettings | The inbox's settings. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | Sign in required (unauthenticated), or confirm this change with your passkey (confirmation_required, or step_up_required with action until confirmations are enforced): the answer carries the action to confirm. |
| 402 | application/problem+json | The organization is read-only (read_only, design note 0024): it has been out of credit for 60 days, so nothing can be changed until an owner adds credit. |
| 403 | application/problem+json | Not allowed (forbidden); or the confirmation isn't this session's (confirmation_invalid), or an API token or assistant asked (needs_person). K8 Messages also refuses personal notice inboxes (k8_notice_inbox), zero-access inboxes (zero_access), and enabling while the organization switch is off (k8_messages_disabled). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | The confirmation is for a different change, or what it changes is different now (confirmation_mismatch), was already used (confirmation_used) or timed out (confirmation_expired). Inbox access may also have changed while you made the request (conflict). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |