K8 HQ

Inboxes — K8 HQ Content API

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

Version 1OpenAPI description (JSON)

Browse operation groups

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

FieldTypeDescription
inboxes requiredContainer[]

Responses

StatusBodyMeaning
200JSONYour inboxes.
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
inbox (path) requiredstringInbox ID (ibx_…).

Responses

StatusBodyMeaning
200InboxThe inbox.
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
inbox (path) requiredstringInbox ID (ibx_…).
x-k8hq-key-sha256 (header)stringThe 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)

FieldTypeDescription
epochs requiredobject[]

Responses

StatusBodyMeaning
200JSONThe sealed epoch keys.
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonYou 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).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
inbox (path) requiredstringInbox ID (ibx_…).
Idempotency-Key (header)stringUp to 255 characters; a retry with the same key gets the first response.

Request body (JSON)

FieldTypeDescription
name requiredstring | null
{"name":"Support"}

Response body (JSON)

FieldTypeDescription
id requiredstringThe inbox (ibx_...).
label requiredstringWhat people see it called: the name, or their grant's label (its first address).
name requiredstringIts name; "" for none.

Responses

StatusBodyMeaning
200JSONThe inbox's name, and what people see it called.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
402application/problem+jsonThe 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.
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonA request with this Idempotency-Key is still running (in_progress).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
inbox (path) requiredstringInbox ID (ibx_…).

Response body (JSON)

FieldTypeDescription
explicit requiredstring[]The settings someone set. rulesMaySend and forwardingOff left unset follow the inbox: allowed while one member has access, off once it's shared.
forwardingOff requiredbooleanMembers 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 requiredbooleanK8 Messages may read this inbox; absent consent means false, with no inherited default.
k8MayReadRevision requiredinteger
mayChange requiredbooleanWhether the caller may change these (inbox.settings.change for this inbox, signed in to the web app; never a personal notice inbox's).
mayDisableK8 requiredboolean
mayEnableK8 requiredboolean
memberRulesOff requiredbooleanOnly 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 requiredbooleanRules 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 requiredbooleanMessages 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 requiredbooleanMessages 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

StatusBodyMeaning
200InboxSettingsThe inbox's settings.
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
inbox (path) requiredstringInbox ID (ibx_…).
Idempotency-Key (header)stringUp to 255 characters; a retry with the same key gets the first response.

Response body (JSON)

FieldTypeDescription
explicit requiredstring[]The settings someone set. rulesMaySend and forwardingOff left unset follow the inbox: allowed while one member has access, off once it's shared.
forwardingOff requiredbooleanMembers 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 requiredbooleanK8 Messages may read this inbox; absent consent means false, with no inherited default.
k8MayReadRevision requiredinteger
mayChange requiredbooleanWhether the caller may change these (inbox.settings.change for this inbox, signed in to the web app; never a personal notice inbox's).
mayDisableK8 requiredboolean
mayEnableK8 requiredboolean
memberRulesOff requiredbooleanOnly 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 requiredbooleanRules 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 requiredbooleanMessages 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 requiredbooleanMessages 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

StatusBodyMeaning
200InboxSettingsThe inbox's settings.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonSign 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.
402application/problem+jsonThe 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.
403application/problem+jsonNot 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).
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonThe 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).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary failure; try again (unavailable).