K8 HQ

Organizations — K8 HQ Content API

Organizations 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.

What each organization permission and role allows, and the organization's search-by-meaning settings.

Base URL

Base URLFor
https://api.k8hq.com/v1API tokens and the K8 HQ web app

Endpoints

Organizations

List members' key fingerprints

GET/key-fingerprints

Each member's user key fingerprint as K8 HQ's mail servers pinned it, the first time they sealed a container's keys to that member (architecture overview S5). The mail servers seal only to the pinned key afterwards, whatever the identity directory says. Compare fingerprints in person or on a call: the web app shows yours as it computes it from the key it unlocked. People signed in to the web app only (?org=); not tokens or assistants. Metered keys.fingerprints, per member listed.

For the web app.

Parameters

NameTypeDescription
org (query)stringThe organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization.

Response body (JSON)

FieldTypeDescription
members requiredobject[]

Responses

StatusBodyMeaning
200JSONThe organization's members (at most 500).
400application/problem+jsonThe request is malformed (invalid).
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).

List K8 HQ staff access

GET/operator-access

What K8 HQ staff did that could reach the organization's data, newest first (architecture overview S6): sessions and commands on the mail server that holds its mail, and other access to that server's disk (cell-wide: they could reach every organization there; shown from the organization's creation on); staff taking the role that can open the keys sealing mail (the key's policy lets only the mail servers and that role open it); keys opened by that role or refused to anyone else, when AWS reports them; and k8hqctl's operator overrides. Not listed: the mail servers' own key use, and staff reading records in AWS's consoles. Recorded from AWS CloudTrail and by k8hqctl. Any member (?org=), people signed in to the web app only. Metered operator_access.read, per entry (at least one a call).

For the web app.

Parameters

NameTypeDescription
org (query)stringThe organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization.
before (query)stringnextCursor from the previous page.
limit (query)integerEntries per page (default 50).

Response body (JSON)

FieldTypeDescription
entries requiredobject[]
nextCursor requiredstringPass as before for older entries; empty at the end.

Responses

StatusBodyMeaning
200JSONA page of entries.
400application/problem+jsonThe request is malformed (invalid).
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 organization's pages address

GET/org/pages

The organization's pages address (https://<slug>.k8hq.page/), where its forms are shown once the organization pages switch is on; enabled is false while it's off, and nothing else is returned. prev is the address it last changed from, which keeps redirecting until prevUntil (90 days). People signed in to the web app who belong to the organization (?org=); mayChange says whether they can change it (org.settings.change, owners by default). Not for access tokens.

For the web app.

Parameters

NameTypeDescription
org (query)stringThe organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization.

Response body (JSON)

FieldTypeDescription
enabled requiredbooleanWhether organization pages are on. While they're off, nothing else is returned and forms stay at https://k8hq.page/f/....
domainstringThe pages domain (k8hq.page).
mayChangebooleanWhether the caller can change it.
prevstringThe address it last changed from, while that still redirects.
prevUntilstringWhen prev stops redirecting and other organizations can take it.
slugstringThe address's first label; empty until one is set (or picked from the organization's name when its first form is published).

Responses

StatusBodyMeaning
200OrgPagesThe address.
400application/problem+jsonThe request is malformed (invalid).
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).

Set or change the organization's pages address

PUT/org/pages

Sets the organization's pages address to https://<slug>.k8hq.page/, or changes it. A slug is 3 to 32 lower-case letters, digits and single hyphens, starting and ending with a letter or digit; some names are kept for K8 HQ (422 rejected). Each address belongs to one organization (409 conflict when another has it). After a change, the old address redirects to the new one for 90 days, and no other organization can take it meanwhile. An organization can change its address 3 times in 90 days (429 rate_limited after that, saying when it can again); the first address and taking back one it still holds don't count. Only while the organization pages switch is on (404 otherwise). People signed in to the web app with org.settings.change (owners by default), read fresh, with a passkey used in the last 5 minutes (401 step_up_required otherwise).

For the web app. 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
org (query)stringThe organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization.
Idempotency-Key (header)stringUp to 255 characters; a retry with the same key gets the first response.

Request body (JSON)

FieldTypeDescription
slug requiredstringThe address's first label: acme for https://acme.k8hq.page/.

Response body (JSON)

FieldTypeDescription
enabled requiredbooleanWhether organization pages are on. While they're off, nothing else is returned and forms stay at https://k8hq.page/f/....
domainstringThe pages domain (k8hq.page).
mayChangebooleanWhether the caller can change it.
prevstringThe address it last changed from, while that still redirects.
prevUntilstringWhen prev stops redirecting and other organizations can take it.
slugstringThe address's first label; empty until one is set (or picked from the organization's name when its first form is published).

Responses

StatusBodyMeaning
200OrgPagesSaved.
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+jsonAnother organization has that address (conflict), or the organization's address changed meanwhile.
422application/problem+jsonNot a slug, or a name kept for K8 HQ (rejected).
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).

List organization permissions

GET/permissions

What each organization permission lets a member do, and the built-in roles. Roles never grant mail: reading and sending come only from access to an inbox. No sign-in needed.

No sign-in needed.

Response body (JSON)

FieldTypeDescription
permissions requiredPermission[]
roles requiredobjectBuilt-in roles and their permissions.

Responses

StatusBodyMeaning
200JSONThe catalog.
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.

Get the organization's search by meaning settings

GET/semantic-settings

Search by meaning (semantic search) finds messages about what you typed even when they don't share its words. It's opt-in per mailbox and paid by the organization: each message's subject, text and attachment names and types (never attachment contents, at most about 8,000 tokens) are sent to an embedding model (Amazon Titan Text Embeddings v2 on AWS Bedrock, in K8 HQ's region; AWS keeps nothing and trains on nothing), and the resulting vectors are stored encrypted with the mailbox's key and deleted with it. Zero-access mailboxes can't be searched by meaning on the server. The organization's default for mailboxes that follow it (off unless set) and its owners' forbid. With estimate=1, also what turning the default on would cost for the mailboxes it would turn on.

For API tokens with api and the web app.

Parameters

NameTypeDescription
org (query)stringThe organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization.
estimate (query)1Include the default's estimate.

Response body (JSON)

FieldTypeDescription
default requiredbooleanMailboxes that follow the organization are searchable by meaning.
forbidden requiredbooleanAn owner forbade sending any message text to an AI model: search by meaning is off everywhere, whatever the mailboxes' settings.
mayChangeCap requiredbooleanOwners only.
mayChangeDefault requiredbooleanPeople with org.settings.change, while the forbid is off.
mayForbid requiredbooleanOwners only.
model requiredstring
monthlyCap requiredstringThe most making mailboxes searchable by meaning may cost a month (default $20); embedding pauses at it, and owners are told at 80% and at it.
prices requiredSemanticPrices
spentThisMonth requiredstringSpent on it this UTC month so far.
estimateSemanticEstimate
followingstring[]With estimate: the mailboxes on only because of the default (turning the default off deletes their vectors).
mailboxesintegerMailboxes the default would turn on (with estimate).

Responses

StatusBodyMeaning
200OrgSemanticSettingsThe settings.
400application/problem+jsonThe request is malformed (invalid).
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 organization's search by meaning settings

PUT/semantic-settings

default: whether mailboxes that follow the organization are searchable by meaning (people with org.settings.change); turning it on confirms the estimate for the mailboxes it turns on, as a mailbox's does, and is refused (409) while the forbid is on. forbidden: owners only: no message text is ever sent to an AI model; it overrides every mailbox's setting and imports, deletes every mailbox's vectors, stops embedding already running, and turns the default off. Lifting it confirms the estimate of the mailboxes it turns back on (those set on themselves, and the default's if it's turned on in the same request). monthlyCap: owners only. An estimate more than what's left of the monthly limit is refused (409). Signed in to the web app with a passkey used in the last 5 minutes. Recorded as org.settings.changed (semanticSearch).

For the web app. 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
org (query)stringThe organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization.
Idempotency-Key (header)stringUp to 255 characters; a retry with the same key gets the first response.

Request body (JSON)

FieldTypeDescription
confirmstringThe estimate's total you agree to, as shown.
defaultboolean
forbiddenboolean
monthlyCapstringOwners only: the monthly limit in dollars ("20", "50.50"), at most $10,000.

Response body (JSON)

FieldTypeDescription
default requiredbooleanMailboxes that follow the organization are searchable by meaning.
forbidden requiredbooleanAn owner forbade sending any message text to an AI model: search by meaning is off everywhere, whatever the mailboxes' settings.
mayChangeCap requiredbooleanOwners only.
mayChangeDefault requiredbooleanPeople with org.settings.change, while the forbid is off.
mayForbid requiredbooleanOwners only.
model requiredstring
monthlyCap requiredstringThe most making mailboxes searchable by meaning may cost a month (default $20); embedding pauses at it, and owners are told at 80% and at it.
prices requiredSemanticPrices
spentThisMonth requiredstringSpent on it this UTC month so far.
estimateSemanticEstimate
followingstring[]With estimate: the mailboxes on only because of the default (turning the default off deletes their vectors).
mailboxesintegerMailboxes the default would turn on (with estimate).

Responses

StatusBodyMeaning
200OrgSemanticSettingsSaved.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
402application/problem+jsonThe estimate is more than the organization's credit (out_of_credit). Or the organization is read-only (read_only): 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).
409JSON, application/problem+jsonTurning it on needs the estimate confirmed (confirm_estimate): send its total as confirm. Or another change of the same Idempotency-Key is still running, or the mailbox can't be searched by meaning (zero-access, 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).