K8 HQ

K8 HQ Setup API

Create organizations, domains and containers. Selected operations also accept personal agent credentials when enabled.

Version 1OpenAPI description (JSON)

Operation groups

Organizations

Create, list, rename and delete organizations, and choose which services each one offers.

12 operations

Organization billing

Who pays for an organization, the fallback payer, and caps on what agents may spend each month.

7 operations

Domains

Add a domain, prove it's yours with DNS records (or one-click DNS setup), and manage its fee and addresses.

13 operations

Inboxes

Create and remove inboxes, and move addresses between them.

7 operations

Boards

Create task and ticket boards, give and remove access, and remove boards.

6 operations

Forms

Create form pages whose responses arrive like mail.

4 operations

Contacts

Organization-owned contact books and membership.

7 operations

Calendar

Set up your K8 HQ calendar the first time you open it.

1 operation

Health

Check a domain's mail health, and the moving checklist and monitors that go with it.

7 operations

Personal agent actions (conditional)

Selected actions for personal apps, available only when the service is enabled. Each attempt checks current access.

10 operations

Find an operation by name

Using this API

Set K8 HQ up without help: create an organization, add a domain and the DNS records that prove it's yours, and create inboxes with addresses there. Each step is what the web app's setup screens call. The Sign-in API starts the session these calls need; the Content API reads and sends mail once an inbox exists.

Requests. Resource reads use GET without a body. Creation uses POST and partial updates use PATCH, as documented. Use these headers where applicable:

Recent passkey. For sessions, every change (creating or renaming an organization, adding or checking a domain, creating an inbox) needs a passkey used in the last 5 minutes, and answers 401 step_up_required otherwise: confirm with the Sign-in API's passkey confirmation and retry with the new access token. Listings don't.

Browsers. Only https://app.k8hq.com may call this API from a browser: CORS preflights from other origins are refused, and a request whose Origin names another site gets 403 forbidden. No cookies are used.

Limits. Each address may make 100 changes (POST, PUT, PATCH or DELETE) to /setup/ in 5 minutes. Reads and preflights do not count toward this limit; all requests still count toward the API limit of 3000 requests per address in 5 minutes. Too many changes returns 429 rate_limited with a problem body and Retry-After: 300; a person may create 3 organizations a day and 20 in all, and have one domain waiting for its TXT record at a time.

The path to a working inbox: Create an organization, Add a domain, add its TXT record, Check, add the three DKIM CNAMEs, Check again until verified, then Create an inbox.

Errors are RFC 9457 problem details with a stable code; see Error codes.

Resource operations use GET for reads, POST for creation and workflows, PATCH for partial updates, and DELETE for removal. Personal agent credentials are accepted only for the operations marked with a conditional personal agent contract, when that service is enabled. JSON mutation bodies sent through CloudFront need their x-amz-content-sha256 hash; GET requests have no body.

Confirmed deletion through the public edge. Delete an organization, domain, inbox, board, form or contact book with a bodyless DELETE and x-k8hq-delete-confirm: encodeURIComponent(typedText). Encode the exact typed UTF-8 text once (maximum 4096 encoded bytes). For example, deleting the organization named “Équipe” uses:

http DELETE /setup/v1/organizations/org_example HTTP/1.1 Host: api.k8hq.com x-k8hq-token: <person-session-access-token> x-k8hq-delete-confirm: %C3%89quipe

Send no body, content-type, or x-amz-content-sha256 for this request. Domain DELETE alone also accepts x-k8hq-remove-addresses: true or false (omitted means false). These headers carry input, not authorization or a signed passkey confirmation. Never combine them with a body. JSON-body canonical DELETE remains supported for direct/local callers, but the deployed public CloudFront OAC edge is known to reject DELETE bodies even with their hash; use headers there.

Personal agents (conditional). Send Authorization: Bearer k8a1_... or Authorization: Bearer k8m1_... through the edge that preserves bearer credentials; do not combine this with x-k8hq-token. The service is off by default and requires explicit operator activation. The documented contract does not enable access. Every attempt, including replay, checks current membership, consent, the exact app approval, credential limits, resource state and any required acknowledgment. Independent service credentials and legacy tokens do not gain these actions.

Personal agent changes require Idempotency-Key: 16 to 128 visible ASCII characters. The key is bound to the person, connection and organization. Different input with the same key fails with 409 conflict. A committed change returns its original result and operation-id (aop_...); replay checks current access and returns the same ID without repeating the change. After an unknown reply, keep the exact input and key. There is no 24-hour key reuse window: active connections retain bindings. Recovery uses GET /api/v1/operations/{aop} on the Content API and checks current access to the original action; it returns only that action’s allowed status fields. A scheduled deletion receipt does not mean deletion has finished.

Personal agent JSON bodies reject unknown or duplicate fields and are limited to 4096 bytes (65536 bytes for rules). On shared routes the session and personal agent body schemas are alternatives: use the Agent schema linked in the operation for the narrower agent contract. A person’s recent-passkey requirement does not apply to an admitted personal agent action; it instead needs the explicit unattended-risk acknowledgment when listed. No other session action becomes available to an agent.

Base URL

Base URLFor
https://api.k8hq.com/setupThe K8 HQ web app, and programs acting with a person's session
curl https://api.k8hq.com/setup/v1/organizations \
  -H "x-k8hq-token: $ACCESS_TOKEN"
Error reference

Error codes

Errors are RFC 9457 problem details (application/problem+json) whose type links here. Branch on code; detail is for people and may change.

CodeMeaning
invalid400: malformed or invalid input; detail says what to fix (a name of 1 to 100 characters, a domain like example.com, 1 to 10 addresses).
unauthenticated401: no session, or it expired or was revoked, or the token isn't a person's own session (assistants' delegated tokens are refused here): refresh or sign in again.
step_up_required401: the change needs a passkey used in the last 5 minutes. Confirm with Start a passkey confirmation on the Sign-in API and retry with the new access token. On a change that needs a confirmation (until confirmations are enforced, a recent passkey still does), the answer also carries action and summary: confirm that instead, as for confirmation_required.
forbidden403: the person may not do this in the organization (it needs an owner or admin), or a browser Origin other than the web app's.
not_found404: no such call, or no such inbox or domain in the organization.
org_limit429: the person created 3 organizations today (try tomorrow), or 20 in all (ask K8 HQ).
new_payer_orgs409: a new payer (until their first card payment is 30 days old, and longer after a chargeback or early fraud warning) pays for at most 3 organizations: creating one (its creator pays) or taking over billing is refused at 3. Ask K8 HQ support at support@k8hq.com.
unproven_domain409: the person already has a domain waiting for its TXT record, in any organization. Finish that one (Check it once the record is in place) or wait until it's released, 7 days after it was added.
domain_taken409: another organization uses the domain.
domain_limit409: the organization has 50 domains, the most it may have without asking K8 HQ.
domain_expired410: the TXT record wasn't found within 7 days, so the domain was released. Add it again for a new record.
domain_unverified409: an address's domain isn't verified in the organization yet: add its records, then Check.
address_taken409: one of the addresses is already in use.
confirm_name400: deleting an organization needs its name typed exactly as it's shown (or its ID if it has none); removing an inbox, its name or one of its addresses; removing a domain, the domain.
owner_only403: only an owner can do this (delete the organization or cancel its deletion, pay for it, be offered billing).
not_payer403: only the person who pays for the organization can change its fallback or offer billing to someone else.
conflict409: billing changed meanwhile (an offer, a handover): read the settings again and retry. Moving an address to a new inbox: the address isn't in the inbox any more.
org_closed410: the organization is being deleted: nothing can change in it any more.
owner_left_recently409: an owner left or was removed in the last 7 days, so the organization can't be scheduled for deletion until 7 days have passed.
nonpayment_deletion409: the pending deletion is K8 HQ's, because the organization has been out of credit for months (design note 0024): owners can't cancel it; adding credit stops it.
inbox_kept409: a member's personal notice inbox (it goes when they leave) or the DMARC reports inbox (ask K8 HQ) isn't removed this way, nor are their addresses moved to a new inbox, nor those of an inbox readable only with its members' own keys; detail says which.
addresses_left409: the domain still has addresses. List a domain's addresses shows them; remove them first, or remove the domain with removeAddresses true.
platform_domain409: k8hq.com, k8hq.net and their subdomains are K8 HQ's own and are never removed.
domain_removing409: the domain is being removed: it can't be checked or added again, or get addresses, until that finishes.
removal_limit429: the organization removed 10 inboxes and domains today; try again tomorrow.
removal_started409: the inbox's purge has started (or it isn't being removed), so it can't be kept.
address_reserved409: the address was freed (deleted, or its inbox removed) in the last 7 days: until then only an owner can put it on another inbox.
address_not_moved409: moving an address to a new inbox made the inbox but didn't move the address (it changed meanwhile, or its domain or inbox is being removed). The address is where it was; inboxId is the new, empty inbox: move an address there, or remove it. With discarded true the new inbox was removed again (the person's access couldn't be given): try again.
connect_unsupported409: the domain's DNS host doesn't offer one-click setup for this step (or not now). Add the records yourself; checkDomain works the same.
connect_not_now409: the step doesn't fit the domain now: mail-verify is for a pending domain, mail-setup for a proven or verified one, mail-dmarc for a verified one.
dmarc_exists409: the domain already has a DMARC record (_dmarc); K8 HQ leaves it as it is (a second one would make DMARC invalid for the domain).
rate_limited429: too many one-click setup links: 20 an hour per organization, 5 per domain, and mail-verify links 10 a day per organization (3 on sending probation); try again later.
release_invalid404: not a valid release link, it was used already, or the claim it names is gone.
release_expired410: the release link has expired (they work for 14 days).
no_credit402: the organization has been out of credit for more than a week (design note 0024), so domains and inboxes can't be added until an owner adds credit on the Billing page. Removing them still works.
read_only402: the organization has been out of credit for 60 days (design note 0024), so it's read-only: its name, domains (adding, checking, fee plans, one-click setup) and inboxes can't be changed or added until an owner adds credit on the Billing page. Removing inboxes and domains still works.
unavailable503 (also 405, a method other than POST): a temporary problem; retry with backoff.
ticket_inbox409: that inbox can't have a ticket board (it has one or isn't one of the organization's shared inboxes).
ticket_members409: a ticket board's members are its inbox's; change the inbox's access instead.
service_disabledThe organization has disabled this service. Existing data remains readable and exportable; an owner or admin can re-enable it in Services settings.
service_unknown400. Choose a service from this organization's Services list.
version_mismatch412: the contact book changed; reload its current version before retrying.
last_holder409: a contact book must keep at least one member who can edit it.
book_read_only409: the contact book is pending removal or purge has started; changes are blocked.
move_changed409: the moving checklist changed since the displayed version. Read its current state and review it before retrying; do not apply an old action to a new checklist.
mail_from_in_use409: the MAIL FROM name chosen already has records in the domain's DNS, or they couldn't be checked: choose a name that's free.
mail_has_addresses409: Mail can be turned off only when the organization has no active email addresses. Remove or disable them first.
mail_off409: Mail is off for the organization, so email addresses can't be added. Turn it on under Services.
sender_unknown404: the sender isn't one the domain's DMARC reports named in the last 90 days (Health, confirm a sender).
confirmation_required401: the change needs a passkey confirmation of exactly it (design note 0013). The answer carries action (the description to confirm) and a short summary: send action to [Begin a confirmation](/auth/docs#confirmBegin), run the passkey prompt, [finish it](/auth/docs#confirmFinish) and retry the same request with the confirmation in x-k8hq-confirm. Asking with x-k8hq-confirm: ? gets this answer without the change being made.
confirmation_invalid403: the confirmation isn't valid for this session (another session's or person's, or not signed by K8 HQ): confirm again.
confirmation_expired409: the confirmation timed out (it lives 2 minutes): confirm again.
confirmation_mismatch409: the change isn't the one confirmed: the request, or what it changes, is different now. Show the current state and let the person confirm again; never retry silently.
confirmation_used409: the confirmation was already used (each confirms one change, once): confirm again.
needs_person403: only a person signed in to K8 HQ can make this change with a passkey confirmation, never an API token or an assistant.
health_changed409: the Health finding changed; read it again before dismissing it.
shared_spam_unavailable403: shared spam reports are not available yet.
zero_access403: zero-access organizations cannot contribute shared spam reports.
client_outdated426: K8 HQ has been updated. Reload this page.
Find a schema by nameBrowse schemas