Organizations — K8 HQ Content API
Organizations operations for K8 HQ Content API. Requests, permissions and responses.
Version 1OpenAPI description (JSON)
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 URL | For |
https://api.k8hq.com/v1 | API 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
| Name | Type | Description |
org (query) | string | The 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)
| Field | Type | Description |
members required | object[] | |
Responses
| Status | Body | Meaning |
| 200 | JSON | The organization's members (at most 500). |
| 400 | application/problem+json | The request is malformed (invalid). |
| 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). |
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
| Name | Type | Description |
org (query) | string | The 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) | string | nextCursor from the previous page. |
limit (query) | integer | Entries per page (default 50). |
Response body (JSON)
| Field | Type | Description |
entries required | object[] | |
nextCursor required | string | Pass as before for older entries; empty at the end. |
Responses
| Status | Body | Meaning |
| 200 | JSON | A page of entries. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 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 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
| Name | Type | Description |
org (query) | string | The 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)
| Field | Type | Description |
enabled required | boolean | Whether organization pages are on. While they're off, nothing else is returned and forms stay at https://k8hq.page/f/.... |
domain | string | The pages domain (k8hq.page). |
mayChange | boolean | Whether the caller can change it. |
prev | string | The address it last changed from, while that still redirects. |
prevUntil | string | When prev stops redirecting and other organizations can take it. |
slug | string | The address's first label; empty until one is set (or picked from the organization's name when its first form is published). |
Responses
| Status | Body | Meaning |
| 200 | OrgPages | The address. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 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). |
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
| Name | Type | Description |
org (query) | string | The 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) | string | Up to 255 characters; a retry with the same key gets the first response. |
Request body (JSON)
| Field | Type | Description |
slug required | string | The address's first label: acme for https://acme.k8hq.page/. |
Response body (JSON)
| Field | Type | Description |
enabled required | boolean | Whether organization pages are on. While they're off, nothing else is returned and forms stay at https://k8hq.page/f/.... |
domain | string | The pages domain (k8hq.page). |
mayChange | boolean | Whether the caller can change it. |
prev | string | The address it last changed from, while that still redirects. |
prevUntil | string | When prev stops redirecting and other organizations can take it. |
slug | string | The address's first label; empty until one is set (or picked from the organization's name when its first form is published). |
Responses
| Status | Body | Meaning |
| 200 | OrgPages | Saved. |
| 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 | Another organization has that address (conflict), or the organization's address changed meanwhile. |
| 422 | application/problem+json | Not a slug, or a name kept for K8 HQ (rejected). |
| 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). |
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)
| Field | Type | Description |
permissions required | Permission[] | |
roles required | object | Built-in roles and their permissions. |
Responses
| Status | Body | Meaning |
| 200 | JSON | The catalog. |
| 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. |
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
| Name | Type | Description |
org (query) | string | The 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) | 1 | Include the default's estimate. |
Response body (JSON)
| Field | Type | Description |
default required | boolean | Mailboxes that follow the organization are searchable by meaning. |
forbidden required | boolean | An owner forbade sending any message text to an AI model: search by meaning is off everywhere, whatever the mailboxes' settings. |
mayChangeCap required | boolean | Owners only. |
mayChangeDefault required | boolean | People with org.settings.change, while the forbid is off. |
mayForbid required | boolean | Owners only. |
model required | string | |
monthlyCap required | string | The 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 required | SemanticPrices | |
spentThisMonth required | string | Spent on it this UTC month so far. |
estimate | SemanticEstimate | |
following | string[] | With estimate: the mailboxes on only because of the default (turning the default off deletes their vectors). |
mailboxes | integer | Mailboxes the default would turn on (with estimate). |
Responses
| Status | Body | Meaning |
| 200 | OrgSemanticSettings | The settings. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 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 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
| Name | Type | Description |
org (query) | string | The 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) | string | Up to 255 characters; a retry with the same key gets the first response. |
Request body (JSON)
| Field | Type | Description |
confirm | string | The estimate's total you agree to, as shown. |
default | boolean | |
forbidden | boolean | |
monthlyCap | string | Owners only: the monthly limit in dollars ("20", "50.50"), at most $10,000. |
Response body (JSON)
| Field | Type | Description |
default required | boolean | Mailboxes that follow the organization are searchable by meaning. |
forbidden required | boolean | An owner forbade sending any message text to an AI model: search by meaning is off everywhere, whatever the mailboxes' settings. |
mayChangeCap required | boolean | Owners only. |
mayChangeDefault required | boolean | People with org.settings.change, while the forbid is off. |
mayForbid required | boolean | Owners only. |
model required | string | |
monthlyCap required | string | The 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 required | SemanticPrices | |
spentThisMonth required | string | Spent on it this UTC month so far. |
estimate | SemanticEstimate | |
following | string[] | With estimate: the mailboxes on only because of the default (turning the default off deletes their vectors). |
mailboxes | integer | Mailboxes the default would turn on (with estimate). |
Responses
| Status | Body | Meaning |
| 200 | OrgSemanticSettings | Saved. |
| 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 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. |
| 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 | JSON, application/problem+json | Turning 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). |
| 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). |