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)
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 URL | For |
https://api.k8hq.com/auth | The 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
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The 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)
| Field | Type | Description |
address required | string | The outside address used for security notices. |
Response body (JSON)
| Field | Type | Description |
message required | "If that address can recover a K8 HQ account, we've sent it a code." | |
requestId required | string | A fresh opaque request ID, also made for unknown addresses. Pattern: ^rrq_[0-9A-Z]{26}$. |
Responses
| Status | Body | Meaning |
| 200 | JSON | The recovery answer. |
| 400 | application/problem+json | Invalid request, or recovery_unavailable: the code or recovery cannot be used. |
| 403 | application/problem+json | The browser origin is not allowed. |
| 429 | application/problem+json | Too many recovery requests or failed sign-in attempts (rate_limited). |
| 500 | application/problem+json | A 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
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The 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)
| Field | Type | Description |
recoveryId | string | The waiting recovery, when cancelling from your own signed-in session. |
token | string | The token from a recovery notice link. |
Response body (JSON)
| Field | Type | Description |
ok required | true | |
Responses
| Status | Body | Meaning |
| 200 | Ok | The recovery answer. |
| 400 | application/problem+json | Invalid request, or recovery_unavailable: the code or recovery cannot be used. |
| 401 | application/problem+json | No session, or it expired or was revoked (unauthenticated): refresh, or sign in again. |
| 403 | application/problem+json | The browser origin is not allowed. |
| 429 | application/problem+json | Too many recovery requests or failed sign-in attempts (rate_limited). |
| 500 | application/problem+json | A 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
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The 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)
| Field | Type | Description |
challengeId required | string | The creation challenge ID from verify. |
credential required | object | The browser WebAuthn assertion response for the pending passkey. |
device | string | An optional name for this device. |
mailApps | boolean | Accepted for compatibility. Mail app tokens are always revoked. |
partitionSecret | string | This 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)
| Field | Type | Description |
newRecoveryKitRequired required | boolean | Make a new recovery kit and confirm it by reopening its file. |
tokens required | Tokens | |
userId required | string | The same account, with its organizations, grants and user key. |
releaseTicket | string | A single-use ticket to unlock the existing server copy in this session; valid five minutes. |
Responses
| Status | Body | Meaning |
| 200 | JSON | The recovery answer. |
| 400 | application/problem+json | Invalid request, or recovery_unavailable: the code or recovery cannot be used. |
| 403 | application/problem+json | The browser origin is not allowed. |
| 409 | application/problem+json | This browser was signed out while this sign-in completed (browser_changed), so no session started; sign in again. |
| 429 | application/problem+json | Too many recovery requests or failed sign-in attempts (rate_limited). |
| 500 | application/problem+json | A 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
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The 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)
| Field | Type | Description |
recoveryId required | string | The waiting recovery from verify. |
Response body (JSON)
| 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). |
Responses
| Status | Body | Meaning |
| 200 | Challenge | The recovery answer. |
| 400 | application/problem+json | Invalid request, or recovery_unavailable: the code or recovery cannot be used. |
| 403 | application/problem+json | The browser origin is not allowed. |
| 429 | application/problem+json | Too many recovery requests or failed sign-in attempts (rate_limited). |
| 500 | application/problem+json | A 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
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The 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)
| Field | Type | Description |
challengeId required | string | The creation challenge ID from verify. |
credential required | object | The browser WebAuthn creation response. |
recoveryId required | string | The recovery ID from verify. |
device | string | An optional name for this device. |
Response body (JSON)
| Field | Type | Description |
expiresAt required | string | When the recovery expires. |
readyAt required | string | When the seventy-two-hour wait ends. |
recoveryId required | string | The waiting recovery. |
Responses
| Status | Body | Meaning |
| 200 | JSON | The recovery answer. |
| 400 | application/problem+json | Invalid request, or recovery_unavailable: the code or recovery cannot be used. |
| 403 | application/problem+json | The browser origin is not allowed. |
| 429 | application/problem+json | Too many recovery requests or failed sign-in attempts (rate_limited). |
| 500 | application/problem+json | A 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)
| Field | Type | Description |
recovery required | object | null | |
Responses
| Status | Body | Meaning |
| 200 | JSON | The recovery answer. |
| 401 | application/problem+json | No session, or it expired or was revoked (unauthenticated): refresh, or sign in again. |
| 403 | application/problem+json | Not allowed (forbidden): an assistant's delegated token, or a browser origin other than the web app's. |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 500 | application/problem+json | A 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
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The 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)
| Field | Type | Description |
code required | string | The eight-digit code in the latest recovery email. Pattern: ^[0-9]{8}$. |
requestId required | string | The request ID returned by begin. |
Response body (JSON)
| Field | Type | Description |
account required | object | |
challengeId required | string | The single-use creation challenge. |
options required | object | WebAuthn credential creation options with publicKey and PRF requested. |
recoveryId required | string | The recovery ID. |
Responses
| Status | Body | Meaning |
| 200 | JSON | The recovery answer. |
| 400 | application/problem+json | Invalid request, or recovery_unavailable: the code or recovery cannot be used. |
| 403 | application/problem+json | The browser origin is not allowed. |
| 429 | application/problem+json | Too many recovery requests or failed sign-in attempts (rate_limited). |
| 500 | application/problem+json | A temporary problem (unavailable); retry. |