Schemas — K8 HQ Sign-in API
Data schemas for K8 HQ Sign-in API.
Schemas
Accepted
The versions the person accepts, by document: each must be the current version or a newer published one.
| Field | Type | Description |
|---|---|---|
privacy | string | Pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. |
terms | string | Pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. |
Action
An action description (design note 0013): what a confirmation names. The route that makes the change builds it from the request and the current state and checks a confirmation against its hash; send it back unchanged. Closed: v, kind, svc, sub, sid, org, target and params (the kind's fields), IDs rather than names.
| Field | Type | Description |
|---|---|---|
kind required | string | What kind of change, e.g. member.role, forward.create. |
params required | object | |
sid required | string | |
sub required | string | |
svc required | auth | setup | content | |
v required | integer | |
org | string | |
target | string |
AgentKeyBinding
A recipient binding: the signed binding B (A.2 transport: unpadded base64url bytes, decimal-string integers), the app's signature, its state and, for a person, its confirmation deadline and fingerprint.
| Field | Type | Description |
|---|---|---|
schemaVersion required | integer | |
agentSignature | string | |
authority | active | revoked | |
binding | object | |
confirmBy | string | Unix seconds the person must confirm a pending binding by (24 hours, at most the connection's expiry). |
display | object | Trusted display identities from K8 HQ's records, never from the app: the app and its publisher from the app registry, the key provider (the app itself when self-hosted) and the organization's name. Only on the person's read. |
fingerprint | string | The full binding fingerprint, lowercase hex. |
pairingSignature | string | |
pairingSignerId | string | |
state | pending | verified | revoked |
Attribution
Where a sign-up came from, from the link that brought the person to K8 HQ's website (carried on its links; nothing is stored in the browser). Each field is optional; a field that doesn't pass its check is dropped, not refused. Kept with the account for 24 months and reported only as totals.
| Field | Type | Description |
|---|---|---|
landing | string | The first page landed on: a path on k8hq.com, without a query. |
ref | string | A referral tag. |
referrer | string | The referring site: only its domain is kept (a URL is cut down to its host). |
utm_campaign | string | |
utm_medium | string | |
utm_source | string | The campaign source tag (letters, digits, spaces and ._~+-). |
Challenge
The start of a passkey ceremony.
| Field | Type | Description |
|---|---|---|
challengeId required | string | Send it back with the passkey's answer. Valid 5 minutes, once. Pattern: ^chl_. |
options required | object | Options for navigator.credentials.create() or .get(). The relying party is k8hq.com; user verification is required, and new passkeys are discoverable (signing in needs no username). |
Change
A change to people that waits for an owner: a non-owner giving or removing people-power (inviting, assigning roles, removing, suspending). A recovery_action asks another owner to approve a bound organization action during the seven days after account recovery. Approval permits one confirmation; the requester retries the same action after confirming again.
| Field | Type | Description |
|---|---|---|
createdAt required | string | |
description required | string | What it does, in words. |
expiresAt required | string | A pending change lapses after 7 days. |
id required | string | |
kind required | role | remove | recovery_action | |
memberId required | string | Whom it changes. |
orgId required | string | The organization (org_...). Pattern: ^org_. |
requestedBy required | string | The member who asked (mem_...). |
status required | pending | approved | declined | cancelled | failed | |
action | object | For recovery_action: the exact action and session another owner is asked to approve. |
requestedAttribution | Attribution | |
role | string | For role: the new role. |
updatedAttribution | Attribution |
Destination
Where copies of a person's notices go besides Notices. Copies to an outside address carry an organization notice's subject only.
| Field | Type | Description |
|---|---|---|
createdAt required | string | |
id required | string | Pattern: ^dst_. |
kind required | inbox | email | An inbox the person can use in one of their organizations, or an outside address (an inbox in an organization they aren't in is one). |
routes required | string[] | security, account, and org:<org_id> for an organization's notices (organizations the person is in). |
status required | active | pending | confirmed | blocked | Inboxes are active at once; outside addresses are pending until their code is typed, and blocked if their reader said the mail wasn't for them. |
address | string | An outside address (as the person typed it, lowercased). |
announcementMutes | string[] | Organizations whose optional service announcements are not copied to this destination. This does not mute security, account or other organization notices. Omitted when none are saved. |
confirmedAt | string | |
inboxId | string | |
orgId | string | |
sharedOk | boolean | The person was warned that others use this inbox, and chose it anyway. |
HPKESuite
The HPKE IDs for this key: KEM 32 (X25519), KDF 1 (HKDF-SHA256), AEAD 2 (AES-256-GCM). If absent on an older record, use these IDs. Refuse any other suite.
| Field | Type | Description |
|---|---|---|
aead required | integer | |
kdf required | integer | |
kem required | integer |
Invite
An invitation to join an organization.
| Field | Type | Description |
|---|---|---|
createdAt required | string | |
expiresAt required | string | 7 days after it was made. |
id required | string | |
madeBy required | string | The member who made it (mem_...). |
orgId required | string | The organization (org_...). Pattern: ^org_. |
role required | guest | member | developer | admin | owner | The member's organization role: guest, member, developer, admin or owner. Guest has no organization permissions and cannot list members, domains or roles. |
status required | pending | accepted | revoked | pending past expiresAt has expired. |
containerIds | string[] | Containers it gives access to, besides membership. |
madeAttribution | Attribution |
JWKS
A JSON Web Key Set: the public keys access tokens are signed with.
| Field | Type | Description |
|---|---|---|
keys required | object[] |
K8Settings
An organization's K8 settings (design note 0010).
| Field | Type | Description |
|---|---|---|
boardsAllowed required | boolean | K8 for Boards is allowed by the organization. Off by default; the server rollout must also be enabled. |
contactsAllowed required | boolean | K8 for Contacts is allowed by the organization. Off by default; the server rollout must also be enabled. |
formsAllowed required | boolean | K8 for Forms is allowed by the organization. Off by default; the server rollout must also be enabled. |
healthAllowed required | boolean | K8 for Health is allowed by the organization. Off by default; the server rollout must also be enabled. |
membersUseK8 required | boolean | Members without k8.use may use K8 (on unless an owner turns it off). |
messagesAllowed required | boolean | K8 Messages, which reads messages, may be turned on for inboxes (off unless an owner turns it on). |
noticesAllowed required | boolean | Members can let K8 read their notices. Off by default; each person must also turn on their own switch and confirm each request. |
KeyWrap
The person's private key, sealed with a secret only they hold (design note 0003).
| Field | Type | Description |
|---|---|---|
id required | string | Chosen by the client: 1 to 100 of A-Z a-z 0-9 _ -. Adding a wrap with an existing ID replaces it. Pattern: ^[A-Za-z0-9_-]{1,100}$. |
kind required | prf | recovery | prf: sealed with a passkey's PRF secret; recovery: sealed with the recovery kit's secret. |
salt required | string | The HKDF salt, 32 bytes, standard base64. |
wrapped required | string | AES-256-GCM (nonce, then ciphertext) of the private key bundle, 28 to 1024 bytes, standard base64. K8 HQ can't open it. |
createdAt | string | Set by K8 HQ. |
credentialId | string | For prf: the passkey's credential ID (base64url). |
LinkTarget
What a notice link opens: an account notice, or an organization notice in the person's personal notice inbox there (read it with the Content API).
| Field | Type | Description |
|---|---|---|
kind required | account | org | |
inboxId | string | |
messageId | string | |
notice | Notice | |
orgId | string |
Member
A member of an organization.
| Field | Type | Description |
|---|---|---|
memberId required | string | |
name required | string | Their display name; empty if they chose none. |
role required | guest | member | developer | admin | owner | The member's organization role: guest, member, developer, admin or owner. Guest has no organization permissions and cannot list members, domains or roles. |
you required | boolean | This is the caller. |
suspendedUntil | string | Set while they're suspended. |
Notice
An account notice: something that changed on the person's account (design note 0012).
| Field | Type | Description |
|---|---|---|
archived required | boolean | Read. |
createdAt required | string | |
id required | string | The event (evt_...). Pattern: ^evt_. |
kind required | passkey_added | passkey_removed | signin_new_network | token_new_network | signup_invite_used | member_removed | member_left | userkey_server_copy_released | policy_change | |
seq required | string | Its place in the person's stream, 20 digits. Archive and delete name a notice by id and seq. Pattern: ^[0-9]{20}$. |
text required | string | What happened and what to do, ending with how to tell a real notice from a fake one. Paragraphs separated by a blank line; no links. |
title required | string | |
country | string | The ISO 3166 country code CloudFront saw, where known. |
network | string | The /24 or /48 network it came from, where it applies. |
org | string | The organization's display name, cleaned. |
orgId | string | The organization (org_...). Pattern: ^org_. |
url | string | A policy change's new version on K8 HQ's website, for the app to link. Never in text. |
NoticeRef
Names one notice.
| Field | Type | Description |
|---|---|---|
id required | string | Pattern: ^evt_. |
seq required | string | Pattern: ^[0-9]{20}$. |
Ok
Done.
| Field | Type | Description |
|---|---|---|
ok required | true |
OrgToken
A token in an organization, as its owners and admins see it.
| Field | Type | Description |
|---|---|---|
containerIds required | string[] | The containers it's narrowed to; null for all its member's. |
createdAt required | string | |
expiresAt required | string | When it expires; empty for never. |
id required | string | Pattern: ^tok_. |
label required | string | |
lastUsedAt required | string | When it was last used, to within an hour; empty for never. Where from isn't shown here: that's its member's to see. |
memberId required | string | The member it acts for (mem_...). |
scopes required | string[] | |
appId | string | Pattern: ^app_. |
ceiling | object | The bounded HTTP credential’s frozen permission and content-capability declaration. Every request also needs its current personal user, resource, application, approval, consent and credential authority. |
connectionId | string | Pattern: ^cnx_. |
kind | bounded_http | Present for an agent-issued bounded personal HTTP credential; legacy tokens omit this field. |
Passkey
One of a person's passkeys.
| Field | Type | Description |
|---|---|---|
addedAt required | string | |
id required | string | The credential ID, base64url. |
provider required | string | Where the passkey lives, when its authenticator says (such as iCloud Keychain, Google Password Manager, 1Password); else Passkey or Security key or passkey provider. |
unlocks required | boolean | A copy of the person's key is sealed with this passkey's PRF secret, so it can unlock zero-access inboxes. |
lastUsedAt | string | Its last sign-in or confirmation. |
PolicyVersion
A published version of K8 HQ's Terms of Service or Privacy Policy. A version's ID is its effective date.
| Field | Type | Description |
|---|---|---|
doc required | terms | privacy | |
effective required | string | When it takes effect (the same date as version). |
sha256 required | string | The SHA-256 of the version's binding text on its page (the HTML between <!-- policy-text --> and <!-- /policy-text -->, ASCII whitespace runs made one space, ends trimmed). A version's text never changes: any edit is a new version. Pattern: ^[0-9a-f]{64}$. |
summary required | string | What changed from the previous version, in a sentence or two. |
title required | string | The document's name, e.g. Terms of Service. |
url required | string | This version's own page on K8 HQ's website. |
version required | string | The version: its effective date (YYYY-MM-DD, from 00:00 UTC). Pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. |
Problem
An RFC 9457 problem detail.
| Field | Type | Description |
|---|---|---|
code required | invalid | unauthenticated | step_up_required | forbidden | approval_required | not_found | conflict | service_disabled | read_only | rate_limited | invite_required | invite_used | org_invite_no_domain | org_signup_limit | policy_acceptance_required | policy_outdated | no_invites_left | not_for_you | exists | too_many | shared_inbox | address_blocked | confirmations_limit | wrong_code | code_expired | too_many_tries | not_pending | changes_limit | no_server_copy | zero_access | wrap_exists | unavailable | confirmation_required | confirmation_invalid | confirmation_expired | confirmation_mismatch | confirmation_used | needs_person | invalid_action | recovery_unavailable | challenge_expired | invalid_proof | keys_bound | revoked | no_key | key_retired | key_exposed | recently_recovered | owner_only | last_holder | rotation_backlog | in_progress | report_too_large | key_in_use | client_outdated | browser_mismatch | browser_unbound | browser_changed | Stable: branch on this. |
status required | integer | |
title required | string | |
type required | string | This page's explanation of the code. |
detail | string | For people; may change. |
until | string | With recently_recovered: when the change becomes possible. |
ServerCopy
K8 HQ keeps a copy of the person's key (design note 0003 section 11).
| Field | Type | Description |
|---|---|---|
enabledAt required | string | When it was turned on. |
SignupInvite
A sign-up invitation a person made.
| Field | Type | Description |
|---|---|---|
createdAt required | string | |
expiresAt required | string | 14 days after it was made. |
id required | string | Pattern: ^siv_. |
status required | pending | accepted | revoked | pending past expiresAt has expired. |
usedAt | string | When someone signed up with it. |
Suspension
A member's suspension: no access to the organization until it ends or is lifted.
| Field | Type | Description |
|---|---|---|
by required | string | The member who suspended them. |
memberId required | string | |
until required | string | 24 hours after it began. |
attribution | Attribution |
Token
One of a person's access tokens.
| Field | Type | Description |
|---|---|---|
createdAt required | string | |
id required | string | The token's ID (tok_...), not its secret. Pattern: ^tok_. |
label required | string | |
orgId required | string | The organization (org_...). Pattern: ^org_. |
scopes required | string[] | What it may do; see the content API's description of scopes. |
appId | string | Pattern: ^app_. |
ceiling | object | The bounded HTTP credential’s frozen permission and content-capability declaration. Every request also needs its current personal user, resource, application, approval, consent and credential authority. |
connectionId | string | Pattern: ^cnx_. |
containerIds | string[] | The containers it's narrowed to; absent for all the member's. |
expiresAt | string | Absent for a token that doesn't expire. |
kind | bounded_http | Present for an agent-issued bounded personal HTTP credential; legacy tokens omit this field. |
lastUsedAt | string | When it was last used (an API request, or a mail app signing in or staying signed in), to within an hour. Absent if it hasn't been used. |
lastUsedNetwork | string | The network it was last used from: the /24 (IPv4) or /48 (IPv6) around the client, as in a new-network notice. Absent if unknown. |
state | active | expired | revoked |
Tokens
A session's tokens.
| Field | Type | Description |
|---|---|---|
accessExpiresAt required | string | When the access token expires; refresh before then. |
accessToken required | string | Send it as x-k8hq-token to this API, the Setup API and the content API. A JWT, valid 15 minutes. |
refreshToken | string | Exchange at Refresh a session for new tokens. Works once; keep it secret (the web app keeps it in local storage). Absent after a passkey confirmation, which keeps the session's refresh token. |
UserKey
A person's key pair for zero-access inboxes: the public halves, and the private halves sealed on their devices.
| Field | Type | Description |
|---|---|---|
ed25519 required | string | The public Ed25519 key (signing), 32 bytes, standard base64. |
wraps required | KeyWrap[] | Sealed copies of the private keys: 1 to 20, at least one recovery. |
x25519 required | string | The public X25519 key (for sealing inbox keys to the person), 32 bytes, standard base64. |
suite | HPKESuite |