K8 HQ

Schemas — K8 HQ Sign-in API

Data schemas for K8 HQ Sign-in API.

Version 1OpenAPI description (JSON)

Browse operation groups

Schemas

Accepted

The versions the person accepts, by document: each must be the current version or a newer published one.

FieldTypeDescription
privacystringPattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}$.
termsstringPattern: ^[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.

FieldTypeDescription
kind requiredstringWhat kind of change, e.g. member.role, forward.create.
params requiredobject
sid requiredstring
sub requiredstring
svc requiredauth | setup | content
v requiredinteger
orgstring
targetstring

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.

FieldTypeDescription
schemaVersion requiredinteger
agentSignaturestring
authorityactive | revoked
bindingobject
confirmBystringUnix seconds the person must confirm a pending binding by (24 hours, at most the connection's expiry).
displayobjectTrusted 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.
fingerprintstringThe full binding fingerprint, lowercase hex.
pairingSignaturestring
pairingSignerIdstring
statepending | 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.

FieldTypeDescription
landingstringThe first page landed on: a path on k8hq.com, without a query.
refstringA referral tag.
referrerstringThe referring site: only its domain is kept (a URL is cut down to its host).
utm_campaignstring
utm_mediumstring
utm_sourcestringThe campaign source tag (letters, digits, spaces and ._~+-).

Challenge

The start of a passkey ceremony.

FieldTypeDescription
challengeId requiredstringSend it back with the passkey's answer. Valid 5 minutes, once. Pattern: ^chl_.
options requiredobjectOptions 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.

FieldTypeDescription
createdAt requiredstring
description requiredstringWhat it does, in words.
expiresAt requiredstringA pending change lapses after 7 days.
id requiredstring
kind requiredrole | remove | recovery_action
memberId requiredstringWhom it changes.
orgId requiredstringThe organization (org_...). Pattern: ^org_.
requestedBy requiredstringThe member who asked (mem_...).
status requiredpending | approved | declined | cancelled | failed
actionobjectFor recovery_action: the exact action and session another owner is asked to approve.
requestedAttributionAttribution
rolestringFor role: the new role.
updatedAttributionAttribution

Destination

Where copies of a person's notices go besides Notices. Copies to an outside address carry an organization notice's subject only.

FieldTypeDescription
createdAt requiredstring
id requiredstringPattern: ^dst_.
kind requiredinbox | emailAn 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 requiredstring[]security, account, and org:<org_id> for an organization's notices (organizations the person is in).
status requiredactive | pending | confirmed | blockedInboxes 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.
addressstringAn outside address (as the person typed it, lowercased).
announcementMutesstring[]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.
confirmedAtstring
inboxIdstring
orgIdstring
sharedOkbooleanThe 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.

FieldTypeDescription
aead requiredinteger
kdf requiredinteger
kem requiredinteger

Invite

An invitation to join an organization.

FieldTypeDescription
createdAt requiredstring
expiresAt requiredstring7 days after it was made.
id requiredstring
madeBy requiredstringThe member who made it (mem_...).
orgId requiredstringThe organization (org_...). Pattern: ^org_.
role requiredguest | member | developer | admin | ownerThe member's organization role: guest, member, developer, admin or owner. Guest has no organization permissions and cannot list members, domains or roles.
status requiredpending | accepted | revokedpending past expiresAt has expired.
containerIdsstring[]Containers it gives access to, besides membership.
madeAttributionAttribution

JWKS

A JSON Web Key Set: the public keys access tokens are signed with.

FieldTypeDescription
keys requiredobject[]

K8Settings

An organization's K8 settings (design note 0010).

FieldTypeDescription
boardsAllowed requiredbooleanK8 for Boards is allowed by the organization. Off by default; the server rollout must also be enabled.
contactsAllowed requiredbooleanK8 for Contacts is allowed by the organization. Off by default; the server rollout must also be enabled.
formsAllowed requiredbooleanK8 for Forms is allowed by the organization. Off by default; the server rollout must also be enabled.
healthAllowed requiredbooleanK8 for Health is allowed by the organization. Off by default; the server rollout must also be enabled.
membersUseK8 requiredbooleanMembers without k8.use may use K8 (on unless an owner turns it off).
messagesAllowed requiredbooleanK8 Messages, which reads messages, may be turned on for inboxes (off unless an owner turns it on).
noticesAllowed requiredbooleanMembers 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).

FieldTypeDescription
id requiredstringChosen 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 requiredprf | recoveryprf: sealed with a passkey's PRF secret; recovery: sealed with the recovery kit's secret.
salt requiredstringThe HKDF salt, 32 bytes, standard base64.
wrapped requiredstringAES-256-GCM (nonce, then ciphertext) of the private key bundle, 28 to 1024 bytes, standard base64. K8 HQ can't open it.
createdAtstringSet by K8 HQ.
credentialIdstringFor 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).

FieldTypeDescription
kind requiredaccount | org
inboxIdstring
messageIdstring
noticeNotice
orgIdstring

Member

A member of an organization.

FieldTypeDescription
memberId requiredstring
name requiredstringTheir display name; empty if they chose none.
role requiredguest | member | developer | admin | ownerThe member's organization role: guest, member, developer, admin or owner. Guest has no organization permissions and cannot list members, domains or roles.
you requiredbooleanThis is the caller.
suspendedUntilstringSet while they're suspended.

Notice

An account notice: something that changed on the person's account (design note 0012).

FieldTypeDescription
archived requiredbooleanRead.
createdAt requiredstring
id requiredstringThe event (evt_...). Pattern: ^evt_.
kind requiredpasskey_added | passkey_removed | signin_new_network | token_new_network | signup_invite_used | member_removed | member_left | userkey_server_copy_released | policy_change
seq requiredstringIts place in the person's stream, 20 digits. Archive and delete name a notice by id and seq. Pattern: ^[0-9]{20}$.
text requiredstringWhat 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 requiredstring
countrystringThe ISO 3166 country code CloudFront saw, where known.
networkstringThe /24 or /48 network it came from, where it applies.
orgstringThe organization's display name, cleaned.
orgIdstringThe organization (org_...). Pattern: ^org_.
urlstringA policy change's new version on K8 HQ's website, for the app to link. Never in text.

NoticeRef

Names one notice.

FieldTypeDescription
id requiredstringPattern: ^evt_.
seq requiredstringPattern: ^[0-9]{20}$.

Ok

Done.

FieldTypeDescription
ok requiredtrue

OrgToken

A token in an organization, as its owners and admins see it.

FieldTypeDescription
containerIds requiredstring[]The containers it's narrowed to; null for all its member's.
createdAt requiredstring
expiresAt requiredstringWhen it expires; empty for never.
id requiredstringPattern: ^tok_.
label requiredstring
lastUsedAt requiredstringWhen 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 requiredstringThe member it acts for (mem_...).
scopes requiredstring[]
appIdstringPattern: ^app_.
ceilingobjectThe 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.
connectionIdstringPattern: ^cnx_.
kindbounded_httpPresent for an agent-issued bounded personal HTTP credential; legacy tokens omit this field.

Passkey

One of a person's passkeys.

FieldTypeDescription
addedAt requiredstring
id requiredstringThe credential ID, base64url.
provider requiredstringWhere the passkey lives, when its authenticator says (such as iCloud Keychain, Google Password Manager, 1Password); else Passkey or Security key or passkey provider.
unlocks requiredbooleanA copy of the person's key is sealed with this passkey's PRF secret, so it can unlock zero-access inboxes.
lastUsedAtstringIts 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.

FieldTypeDescription
doc requiredterms | privacy
effective requiredstringWhen it takes effect (the same date as version).
sha256 requiredstringThe 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 requiredstringWhat changed from the previous version, in a sentence or two.
title requiredstringThe document's name, e.g. Terms of Service.
url requiredstringThis version's own page on K8 HQ's website.
version requiredstringThe 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.

FieldTypeDescription
code requiredinvalid | 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_changedStable: branch on this.
status requiredinteger
title requiredstring
type requiredstringThis page's explanation of the code.
detailstringFor people; may change.
untilstringWith recently_recovered: when the change becomes possible.

ServerCopy

K8 HQ keeps a copy of the person's key (design note 0003 section 11).

FieldTypeDescription
enabledAt requiredstringWhen it was turned on.

SignupInvite

A sign-up invitation a person made.

FieldTypeDescription
createdAt requiredstring
expiresAt requiredstring14 days after it was made.
id requiredstringPattern: ^siv_.
status requiredpending | accepted | revokedpending past expiresAt has expired.
usedAtstringWhen someone signed up with it.

Suspension

A member's suspension: no access to the organization until it ends or is lifted.

FieldTypeDescription
by requiredstringThe member who suspended them.
memberId requiredstring
until requiredstring24 hours after it began.
attributionAttribution

Token

One of a person's access tokens.

FieldTypeDescription
createdAt requiredstring
id requiredstringThe token's ID (tok_...), not its secret. Pattern: ^tok_.
label requiredstring
orgId requiredstringThe organization (org_...). Pattern: ^org_.
scopes requiredstring[]What it may do; see the content API's description of scopes.
appIdstringPattern: ^app_.
ceilingobjectThe 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.
connectionIdstringPattern: ^cnx_.
containerIdsstring[]The containers it's narrowed to; absent for all the member's.
expiresAtstringAbsent for a token that doesn't expire.
kindbounded_httpPresent for an agent-issued bounded personal HTTP credential; legacy tokens omit this field.
lastUsedAtstringWhen 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.
lastUsedNetworkstringThe network it was last used from: the /24 (IPv4) or /48 (IPv6) around the client, as in a new-network notice. Absent if unknown.
stateactive | expired | revoked

Tokens

A session's tokens.

FieldTypeDescription
accessExpiresAt requiredstringWhen the access token expires; refresh before then.
accessToken requiredstringSend it as x-k8hq-token to this API, the Setup API and the content API. A JWT, valid 15 minutes.
refreshTokenstringExchange 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.

FieldTypeDescription
ed25519 requiredstringThe public Ed25519 key (signing), 32 bytes, standard base64.
wraps requiredKeyWrap[]Sealed copies of the private keys: 1 to 20, at least one recovery.
x25519 requiredstringThe public X25519 key (for sealing inbox keys to the person), 32 bytes, standard base64.
suiteHPKESuite