K8 HQ Sign-in API
Sign up and sign in with passkeys, and manage a person's sessions, passkeys, tokens, invitations and organization members.
Operation groups
Sign-up and sign-in
Create an account or sign in with a passkey. Each ceremony is two calls: start, then finish with the browser's passkey response.
4 operations
Sessions
Refresh, confirm and end sessions. Use these to keep an access token fresh and to confirm a recent passkey before sensitive changes.
8 operations
Account
Read the signed-in person's account and change their display name.
2 operations
Policies
See which terms and policy versions the person still has to accept, and accept them.
3 operations
Passkeys
List, add and remove the passkeys that sign a person in.
4 operations
User keys
Create and unlock the person's own encryption key, and choose whether K8 HQ keeps a copy for recovery.
7 operations
Access tokens
Create and revoke your own access tokens for scripts, AI agents and integrations. Owners and admins can also list and revoke any token in the organization.
5 operations
Sign-up invitations
Make and revoke invitations that let someone new create a K8 HQ account.
3 operations
Members
List an organization's members and change their roles, suspend, remove or leave.
9 operations
Invites
Invite people to an organization, and preview or accept an invite you were sent.
5 operations
Pending changes
Changes to people that wait for an owner: list them, approve, decline or cancel.
3 operations
K8
K8, the built-in assistant: its settings and the delegated token it acts with.
10 operations
Notices
The person's account notices: list them, mark them read, follow their links and delete them.
4 operations
Notifications
Where notices are sent besides the web app (email addresses), and which kinds each destination gets.
9 operations
Service
The public keys session access tokens are signed with, for services that verify tokens offline.
1 operation
Sign-in recovery
Recover a K8 HQ account after losing every passkey, using an outside address and a copy of the key kept by K8 HQ.
7 operations
Agent key bindings
Apps connected by a person prove they hold the keys K8 HQ may later share with them, and the person confirms them.
5 operations
Find an operation by name
- Start signing in —
POST /v1/login/begin - Finish signing in —
POST /v1/login/finish - Start signing up —
POST /v1/signup/begin - Finish signing up —
POST /v1/signup/finish - Sign out of this browser —
DELETE /v1/account/browser-sessions - Sign out —
DELETE /v1/account/session - Sign out everywhere —
DELETE /v1/account/sessions - Begin a confirmation —
POST /v1/confirm/begin - Finish a confirmation —
POST /v1/confirm/finish - Refresh a session —
POST /v1/refresh - Start a passkey confirmation —
POST /v1/stepup/begin - Finish a passkey confirmation —
POST /v1/stepup/finish - Get the account —
GET /v1/account - Change the display name —
PATCH /v1/account - Policy versions to accept —
GET /v1/account/policy-status - List policy versions —
GET /v1/policies - Accept policy versions —
POST /v1/policies/accept - List passkeys —
GET /v1/passkeys - Add a passkey —
POST /v1/passkeys/begin - Finish adding a passkey —
POST /v1/passkeys/finish - Remove a passkey —
DELETE /v1/passkeys/{id} - Get the person's key —
GET /v1/keys - Create the person's key —
PUT /v1/keys - Replace the person's key —
POST /v1/keys/replace - Unlock with K8 HQ's copy of the key —
POST /v1/keys/server-copy - Turn on K8 HQ's copy of the key —
PUT /v1/keys/server-copy - Turn off K8 HQ's copy of the key —
DELETE /v1/keys/server-copy - Add a sealed copy of the key —
POST /v1/keys/wraps - List my tokens —
GET /v1/account/tokens - Create a token —
POST /v1/account/tokens - Revoke my token —
DELETE /v1/account/tokens/{id} - List an organization's tokens —
GET /v1/organizations/{orgId}/tokens - Revoke an organization's token —
DELETE /v1/organizations/{orgId}/tokens/{id} - List my sign-up invitations —
GET /v1/account/signup-invites - Make a sign-up invitation —
POST /v1/account/signup-invites - Revoke a sign-up invitation —
DELETE /v1/account/signup-invites/{id} - Check a people change —
GET /v1/members/check - Report an inbox's keys as possibly exposed —
POST /v1/members/compromise - List members —
GET /v1/organizations/{orgId}/members - See which members can recover their accounts —
GET /v1/organizations/{orgId}/members/recovery - Change a member's role —
PATCH /v1/organizations/{orgId}/members/{memberId} - Remove a member —
DELETE /v1/organizations/{orgId}/members/{memberId} - Suspend a member —
PUT /v1/organizations/{orgId}/members/{memberId}/suspension - Lift a suspension —
DELETE /v1/organizations/{orgId}/members/{memberId}/suspension - Leave an organization —
DELETE /v1/organizations/{orgId}/membership - Accept an invite —
POST /v1/invites/accept - Preview an invite —
POST /v1/invites/preview - List invites —
GET /v1/organizations/{orgId}/invites - Invite someone —
POST /v1/organizations/{orgId}/invites - Revoke an invite —
DELETE /v1/organizations/{orgId}/invites/{id} - Approve a change —
POST /v1/changes/approve - Decline or cancel a change —
POST /v1/changes/decline - List pending changes —
GET /v1/organizations/{orgId}/changes - Your K8 HQ Notices setting —
GET /v1/account/k8-notices - Change your K8 HQ Notices setting —
PUT /v1/account/k8-notices - Get a delegated token for K8 —
POST /v1/k8/token - Get K8 settings —
GET /v1/organizations/{orgId}/k8-settings - Change K8 settings —
PUT /v1/organizations/{orgId}/k8-settings - Change K8 for Boards —
PUT /v1/organizations/{orgId}/k8-settings/boards - Change K8 for Contacts —
PUT /v1/organizations/{orgId}/k8-settings/contacts - Change K8 for Forms —
PUT /v1/organizations/{orgId}/k8-settings/forms - Change K8 for Health —
PUT /v1/organizations/{orgId}/k8-settings/health - Change K8 for Notices —
PUT /v1/organizations/{orgId}/k8-settings/notices - Mark notices read —
PATCH /v1/account/notices - Delete notices —
DELETE /v1/account/notices - List account notices —
POST /v1/notices - Open a notice link —
POST /v1/notices/link - List notification destinations —
GET /v1/account/destinations - Add a destination —
POST /v1/account/destinations - Remove a destination —
DELETE /v1/account/destinations/{id} - Change what a destination gets —
PUT /v1/account/destinations/{id}/routes - Mute kinds of notices —
PUT /v1/account/notice-preferences - Keep notices in Notices only —
POST /v1/destinations/ask/dismiss - Confirm a destination —
POST /v1/destinations/confirm - Send a new code —
POST /v1/destinations/resend - Stop emails to an address —
POST /v1/destinations/stop - Get the signing keys —
GET /.well-known/jwks.json - Ask for a recovery code —
POST /v1/recovery/begin - Cancel a recovery —
POST /v1/recovery/cancel - Complete recovery —
POST /v1/recovery/complete - Finish recovery with the new passkey —
POST /v1/recovery/complete/begin - Start the recovery —
POST /v1/recovery/start - See a waiting recovery —
GET /v1/recovery/status - Check a recovery code —
POST /v1/recovery/verify - Prove an app holds its keys —
POST /v1/agent-key-bindings - Start pairing an app's keys —
POST /v1/agent-key-bindings/challenges - Read an app's key binding —
GET /v1/agent-key-bindings/{id} - Replace an app's key binding —
POST /v1/agent-key-bindings/{id}/replace - Confirm an app's key binding —
POST /v1/agent-key-bindings/{id}/verify
Using this API
Passkey sign-in for K8 HQ, and everything about a person's account: sessions, passkeys, access tokens, invitations, the members of their organizations, K8 settings and account notices. The Content API reads and sends messages; the Setup API creates organizations, domains and inboxes.
Requests. Resource reads use GET without a body. JSON writes use POST, PUT, PATCH or DELETE as documented. Requests use these headers where applicable:
content-type: application/json.x-amz-content-sha256: the body's SHA-256 in lowercase hex. api.k8hq.com reaches this service through CloudFront, which signs each request to it; a JSON mutation without the right hash is refused with 403 before it gets here (not a problem detail). For mutations with no fields, send{}and hash exactly the bytes you send. Bodyless GET requests do not need this header.x-k8hq-token: the session's access token, on every call but the sign-up, sign-in, recovery and refresh ceremonies. NotAuthorization, which CloudFront uses for its own signature.
Sessions. Signing up or in with a passkey starts a session: an access token (a JWT, valid 15 minutes) and a refresh token (30 days). Exchange the refresh token at Refresh a session before the access token expires; each one works once, and presenting a spent one ends the session. The same access token works on the content API and the Setup API.
Recent passkey (step-up). Changes to credentials, people and settings need a passkey used in the last 5 minutes; each such call says so. Otherwise it answers 401 step_up_required: run Start a passkey confirmation and Finish it (the passkey prompt, on the same page), then retry with the new access token. Refreshing doesn't renew the confirmation.
A person's own session. Every call acts for the person signed in and none takes a user ID. API tokens (k8hq_...) aren't accepted here. Assistants' delegated tokens (Get a delegated token for K8) get 403 forbidden, except K8 Admin's on the three listings that say so, and only in the organization the token was made for.
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 (against cross-site request forgery). Programs that send no Origin aren't affected. No cookies are used.
Limits. Each network address may make 100 sign-in, sign-up and recovery POSTs in 5 minutes under /auth/v1/login/, /auth/v1/signup/ and /auth/v1/recovery/. A sign-in uses two requests; recovery uses a handful. Other /auth/ requests, excluding OPTIONS, have a separate limit of 300 per address in 5 minutes, including GET /auth/v1/recovery/status. Browser preflights count toward neither auth budget. Neither budget uses the other. For these limits, paths are URL-decoded, normalized and matched in lowercase. Both return 429 rate_limited with a problem body and Retry-After: 300. All requests still count toward the broader API limit of 3000 per address in 5 minutes, which can return 403. Edge enforcement is approximate. Separately, 20 failed passkey ceremonies in 15 minutes get 429 rate_limited until the window passes.
Errors are RFC 9457 problem details with a stable code; see Error codes.
Resource operations use GET for reads, POST for creation and workflows, PUT for whole resources, PATCH for partial updates, and DELETE for removal. Credential requirements are unchanged; this release does not add external-agent administrative authorization. JSON mutation bodies sent through CloudFront need their x-amz-content-sha256 hash; GET requests have no body.
Base URL
| Base URL | For |
|---|---|
https://api.k8hq.com/auth | The K8 HQ web app, and programs acting with a person's session |
curl https://api.k8hq.com/auth/v1/passkeys \
-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.
| Code | Meaning |
|---|---|
invalid | 400 (also 405 and 410): malformed or refused input; detail says what. 410 here is an invite link that isn't valid any more. |
unauthenticated | 401: no session, or it expired or was revoked: refresh, or sign in again. Also a passkey that isn't recognized. |
step_up_required | 401: the action needs a passkey used in the last 5 minutes. Run Start a passkey confirmation and Finish it, then retry with the new access token. |
forbidden | 403: not allowed: the member's role or permissions, an assistant's delegated token where it isn't accepted, or a browser Origin other than the web app's. |
approval_required | 403: This connection needs approval for that, and approval isn't available yet. |
not_found | 404: no such record, or one you may not see (organizations you aren't in answer the same way). |
conflict | 409: refused by the current state, such as the last passkey or the last owner. |
service_disabled | 403: K8 is disabled for this organization; an owner or admin can enable it in Services settings. |
read_only | 402: the organization is read-only because it's out of credit (design note 0024): nobody can be invited to it or join it until an owner adds credit. |
rate_limited | 429: too many requests from this network (wait a few minutes), too many failed passkey ceremonies (wait 15 minutes), or today's invites are made. |
invite_required | 403: signing up needs an invitation: a sign-up invitation or an organization's invite link. |
invite_used | 410: the sign-up invitation was used, revoked or has expired. |
org_invite_no_domain | 403: the organization's invite can't sign up new people until the organization proves a domain. |
org_signup_limit | 429: the organization has signed up as many new people as it may today. |
policy_acceptance_required | 400: accept the current Terms of Service and Privacy Policy: name each current version in accepted. |
policy_outdated | 409: a policy version named isn't the current one (or isn't published): fetch the current versions and ask the person again. |
no_invites_left | 409: the person has no sign-up invitations left; revoked and expired ones come back. |
not_for_you | 404: a notice link that isn't for the signed-in person (or was changed, or made up). Every real notice is also in Notices. |
exists | 409: that inbox or address is already one of the person's destinations. |
too_many | 409: the person has as many destinations as allowed (3 outside addresses, 5 inboxes). |
shared_inbox | 409: others use this inbox too: show detail (what they'd see) and retry with sharedOk if the person still wants it. |
address_blocked | 409: whoever reads this address said a K8 HQ confirmation mail wasn't for them; K8 HQ won't email it again. |
confirmations_limit | 429: the person has had today's 5 confirmation emails. |
wrong_code | 400: the confirmation code isn't right (or hasn't arrived yet). |
code_expired | 410: the confirmation code has expired: send a new one. |
too_many_tries | 429: too many wrong codes: send a new one. |
not_pending | 409: the destination isn't waiting for a confirmation code. |
changes_limit | 429: the person has made today's 20 destination changes (each is a security notice to every destination). |
no_server_copy | 404: K8 HQ keeps no copy of the person's key; unlock with a passkey that supports it, or the recovery kit. |
zero_access | 409: the person uses a zero-access inbox, which needs their own key, so K8 HQ can't keep a copy of it. |
wrap_exists | 409: the person's key already has a wrap with that ID. Wraps are never replaced; add the new one under a new ID. |
unavailable | 500 or 503: a temporary problem on K8 HQ's side; retry with backoff. |
confirmation_required | 401: 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_invalid | 403: the confirmation isn't valid for this session (another session's or person's, or not signed by K8 HQ): confirm again. |
confirmation_expired | 409: the confirmation timed out (it lives 2 minutes): confirm again. |
confirmation_mismatch | 409: 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_used | 409: the confirmation was already used (each confirms one change, once): confirm again. |
needs_person | 403: only a person signed in to K8 HQ can make this change with a passkey confirmation, never an API token or an assistant. |
invalid_action | 400: that isn't a change K8 HQ can confirm (not a route's description, another session's, or an invalid list). 409: the saved list of changes is no longer valid at confirmation finish. |
recovery_unavailable | 400: The recovery code is wrong or expired, or the recovery no longer meets the checks. Ask for a new code. |
challenge_expired | 409: the pairing request or the binding's confirmation deadline passed; start pairing again with new keys. |
invalid_proof | 422: a proof of possession or a signature didn't verify. |
keys_bound | 409: these public keys are already bound; generate new keys. |
revoked | 409: the binding was revoked or replaced. |
no_key | 409: the person has no key yet: set one up first. |
key_retired | 409: the new key was this person's before and was replaced; a replaced key never comes back. Make a new one. |
key_exposed | 409: the new key was reported as possibly exposed. Make a new one. |
recently_recovered | 403: the person recovered their account by email in the last 7 days; until says when the change becomes possible. |
owner_only | 403: only an owner of the organization may do this. |
last_holder | 409: the change would leave a zero-access inbox with nobody who can open it. |
rotation_backlog | 503: K8 HQ is still updating an inbox's encryption after earlier changes; retry after Retry-After seconds. |
in_progress | 409: the inbox's switch to zero-access isn't finished yet. |
report_too_large | 409: the report would be too large for one change: report at most two people at once, or one at a time. |
key_in_use | 409: the new key belongs to another account; every key has one owner. Make a new one. |
client_outdated | 426: K8 HQ has been updated. Reload this page. |
browser_mismatch | 409: the session signed in from this browser before its storage was reset (DELETE /v1/account/browser-sessions): the browser's other sessions can't be found from it. Nothing was signed out; sign this session out with DELETE /v1/account/session and use Sign out everywhere for the rest. |
browser_unbound | 409: the session is from before browser secrets (DELETE /v1/account/browser-sessions). Nothing was signed out; sign this session out with DELETE /v1/account/session instead. |
browser_changed | 409: the browser was signed out (DELETE /v1/account/browser-sessions) while this sign-in completed, so no session started. Start the sign-in again. |