K8 HQ

Sign-in recovery — K8 HQ Sign-in API

Sign-in recovery operations for K8 HQ Sign-in API. Requests, permissions and responses.

Version 1OpenAPI description (JSON)

Browse operation groups

Before making requests, read the authentication and request requirements.

Recover a K8 HQ account after losing every passkey, using an outside address and a copy of the key kept by K8 HQ.

Base URL

Base URLFor
https://api.k8hq.com/authThe K8 HQ web app, and programs acting with a person's session

Endpoints

Sign-in recovery

Ask for a recovery code

POST/v1/recovery/begin

No sign-in needed. Always returns the same answer and a fresh request ID, whether or not the address belongs to an account. Address checks and sending have a fixed time budget; refusals and sender failures give the same answer. Only a confirmed outside address routed for security notices for at least seven days can recover an account, and only while K8 HQ keeps a copy of its key and it has no zero-access inboxes. At most three code or explanation emails per address per UTC day, across all accounts. Code emails have no link. The code works for thirty minutes. A separate recovery sender checks whether the address is blocked or has bounced before sending. All recovery routes share a limit of ten requests per client IP per UTC hour, in addition to the auth limit at the edge. Answers are never cached.

No sign-in needed.

Parameters

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). For {}: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a.

Request body (JSON)

FieldTypeDescription
address requiredstringThe outside address used for security notices.

Response body (JSON)

FieldTypeDescription
message required"If that address can recover a K8 HQ account, we've sent it a code."
requestId requiredstringA fresh opaque request ID, also made for unknown addresses. Pattern: ^rrq_[0-9A-Z]{26}$.

Responses

StatusBodyMeaning
200JSONThe recovery answer.
400application/problem+jsonInvalid request, or recovery_unavailable: the code or recovery cannot be used.
403application/problem+jsonThe browser origin is not allowed.
429application/problem+jsonToo many recovery requests or failed sign-in attempts (rate_limited).
500application/problem+jsonA temporary problem (unavailable); retry.

Cancel a recovery

POST/v1/recovery/cancel

Use a cancel token from a recovery notice, without signing in, or send recoveryId with your own session and a passkey confirmation in the last five minutes. In-app notices have no cancel token. Cancelling through a link sent to another destination counts toward neither the start cap nor the cancel cooldown. Cancel and completion compete in one transaction; only one can win.

No sign-in needed.

Parameters

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). For {}: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a.

Request body (JSON)

FieldTypeDescription
recoveryIdstringThe waiting recovery, when cancelling from your own signed-in session.
tokenstringThe token from a recovery notice link.

Response body (JSON)

FieldTypeDescription
ok requiredtrue

Responses

StatusBodyMeaning
200OkThe recovery answer.
400application/problem+jsonInvalid request, or recovery_unavailable: the code or recovery cannot be used.
401application/problem+jsonNo session, or it expired or was revoked (unauthenticated): refresh, or sign in again.
403application/problem+jsonThe browser origin is not allowed.
429application/problem+jsonToo many recovery requests or failed sign-in attempts (rate_limited).
500application/problem+jsonA temporary problem (unavailable); retry.

Complete recovery

POST/v1/recovery/complete

Checks the pending passkey and all eligibility again, including transaction conditions on the waiting record, ACTIVE, unchanged confirmed security-routed recovery address, block record, server copy and zero-access markers. Replaces all old passkeys, removes PRF and old recovery-kit wraps, signs out old sessions, always revokes API and mail app tokens, records completion and owner notices, and starts a new session. The new session can use the one-time release ticket to unlock the same user key. Keep the server copy on, add a PRF wrap when supported, and require a new recovery kit confirmed by reopening the file. Records the seven-day recently recovered period.

No sign-in needed.

Parameters

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). For {}: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a.

Request body (JSON)

FieldTypeDescription
challengeId requiredstringThe creation challenge ID from verify.
credential requiredobjectThe browser WebAuthn assertion response for the pending passkey.
devicestringAn optional name for this device.
mailAppsbooleanAccepted for compatibility. Mail app tokens are always revoked.
partitionSecretstringThis browser's secret for signing out: 32 random bytes in base64url (no padding), made once per browser storage partition and kept there. K8 HQ keeps only a hash of it, so knowing a browser's ID never lets another sign-in join that browser. Sent with every sign-in from the web app, so Forget this browser can end them all (DELETE /v1/account/browser-sessions); the session keeps it through refreshes. Leave it out from anything but the web app. A value that isn't one is refused (invalid) before the passkey answer is used. Pattern: ^[A-Za-z0-9_-]{43}$.

Response body (JSON)

FieldTypeDescription
newRecoveryKitRequired requiredbooleanMake a new recovery kit and confirm it by reopening its file.
tokens requiredTokens
userId requiredstringThe same account, with its organizations, grants and user key.
releaseTicketstringA single-use ticket to unlock the existing server copy in this session; valid five minutes.

Responses

StatusBodyMeaning
200JSONThe recovery answer.
400application/problem+jsonInvalid request, or recovery_unavailable: the code or recovery cannot be used.
403application/problem+jsonThe browser origin is not allowed.
409application/problem+jsonThis browser was signed out while this sign-in completed (browser_changed), so no session started; sign in again.
429application/problem+jsonToo many recovery requests or failed sign-in attempts (rate_limited).
500application/problem+jsonA temporary problem (unavailable); retry.

Finish recovery with the new passkey

POST/v1/recovery/complete/begin

After the seventy-two-hour wait, asks for the pending passkey only. Checks that recovery still waits, has not expired and remains eligible. The assertion challenge lasts five minutes.

No sign-in needed.

Parameters

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). For {}: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a.

Request body (JSON)

FieldTypeDescription
recoveryId requiredstringThe waiting recovery from verify.

Response body (JSON)

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

Responses

StatusBodyMeaning
200ChallengeThe recovery answer.
400application/problem+jsonInvalid request, or recovery_unavailable: the code or recovery cannot be used.
403application/problem+jsonThe browser origin is not allowed.
429application/problem+jsonToo many recovery requests or failed sign-in attempts (rate_limited).
500application/problem+jsonA temporary problem (unavailable); retry.

Start the recovery

POST/v1/recovery/start

No sign-in needed. Checks the new passkey against the recovery challenge and checks eligibility again. In one transaction saves the passkey as pending, starts a seventy-two-hour wait, locks the account to one waiting recovery, and records security notices for the person and the other owners of organizations where they hold people or access powers. The pending passkey cannot sign in. The wait applies to this passkey only. Recovery can be finished for seven days after the wait. At most three starts in thirty days, and none within twenty-four hours after cancellation; a cancel link sent to a different destination counts toward neither limit. Requests that only asked for a code do not count as starts. This call issues no session or key-release ticket. All recovery routes share a limit of ten requests per client IP per UTC hour, in addition to the auth limit at the edge. Answers are never cached.

No sign-in needed.

Parameters

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). For {}: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a.

Request body (JSON)

FieldTypeDescription
challengeId requiredstringThe creation challenge ID from verify.
credential requiredobjectThe browser WebAuthn creation response.
recoveryId requiredstringThe recovery ID from verify.
devicestringAn optional name for this device.

Response body (JSON)

FieldTypeDescription
expiresAt requiredstringWhen the recovery expires.
readyAt requiredstringWhen the seventy-two-hour wait ends.
recoveryId requiredstringThe waiting recovery.

Responses

StatusBodyMeaning
200JSONThe recovery answer.
400application/problem+jsonInvalid request, or recovery_unavailable: the code or recovery cannot be used.
403application/problem+jsonThe browser origin is not allowed.
429application/problem+jsonToo many recovery requests or failed sign-in attempts (rate_limited).
500application/problem+jsonA temporary problem (unavailable); retry.

See a waiting recovery

GET/v1/recovery/status

Reads the ACTIVE recovery lock. Use this for the banner on every page. Deleting or reading a notice cannot hide a waiting recovery. No cancel token is returned.

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.

Response body (JSON)

FieldTypeDescription
recovery requiredobject | null

Responses

StatusBodyMeaning
200JSONThe recovery answer.
401application/problem+jsonNo session, or it expired or was revoked (unauthenticated): refresh, or sign in again.
403application/problem+jsonNot allowed (forbidden): an assistant's delegated token, or a browser origin other than the web app's.
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
500application/problem+jsonA temporary problem (unavailable); retry.

Check a recovery code

POST/v1/recovery/verify

No sign-in needed. Counts the try before checking any code. Each request allows five tries; wrong codes also count toward the sign-in failure limit. A request that does not exist costs no code check. A matching code returns the account's name, the month it was created, and creation options for a new passkey. The challenge lasts five minutes, requests PRF support and uses the account's existing passkey handle. Pass options to navigator.credentials.create(), then send the result to Start the recovery. Wrong, expired and refused codes have the same answer. All recovery routes share a limit of ten requests per client IP per UTC hour, in addition to the auth limit at the edge. Answers are never cached.

No sign-in needed.

Parameters

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). For {}: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a.

Request body (JSON)

FieldTypeDescription
code requiredstringThe eight-digit code in the latest recovery email. Pattern: ^[0-9]{8}$.
requestId requiredstringThe request ID returned by begin.

Response body (JSON)

FieldTypeDescription
account requiredobject
challengeId requiredstringThe single-use creation challenge.
options requiredobjectWebAuthn credential creation options with publicKey and PRF requested.
recoveryId requiredstringThe recovery ID.

Responses

StatusBodyMeaning
200JSONThe recovery answer.
400application/problem+jsonInvalid request, or recovery_unavailable: the code or recovery cannot be used.
403application/problem+jsonThe browser origin is not allowed.
429application/problem+jsonToo many recovery requests or failed sign-in attempts (rate_limited).
500application/problem+jsonA temporary problem (unavailable); retry.