Passkeys — K8 HQ Sign-in API
Passkeys operations for K8 HQ Sign-in API. Requests, permissions and responses.
Before making requests, read the authentication and request requirements.
List, add and remove the passkeys that sign a person in.
Base URL
| Base URL | For |
|---|---|
https://api.k8hq.com/auth | The K8 HQ web app, and programs acting with a person's session |
Endpoints
Passkeys
List passkeys
The person's passkeys, oldest first.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.
Response body (JSON)
| Field | Type | Description |
|---|---|---|
passkeys required | Passkey[] |
Responses
| Status | Body | Meaning |
|---|---|---|
| 200 | JSON | The passkeys. |
| 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. |
Add a passkey
Starts registering another passkey for the signed-in person (ones they already have are excluded). Pass options to navigator.credentials.create() and send the result to Finish adding a passkey.
Needs a passkey confirmation of this change (x-k8hq-confirm: passkey.add). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused. The session needs a recent passkey: if its last passkey confirmation is more than 5 minutes old, the answer is 401 step_up_required.
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. |
{}
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 ceremony's options. Pass options to the browser, then send its answer to the matching finish call within 5 minutes. |
| 401 | application/problem+json | No session or it expired (unauthenticated), or confirm this change with your passkey (confirmation_required; until confirmations are enforced, step_up_required with action, which a passkey use in the last 5 minutes also satisfies): the answer carries the action to confirm and a short summary. |
| 403 | application/problem+json | Not allowed (forbidden); or the confirmation isn't this session's (confirmation_invalid), or an API token or assistant asked (needs_person). |
| 409 | application/problem+json | The confirmation is for a different change, or what it changes is different now (confirmation_mismatch), was already used (confirmation_used) or timed out (confirmation_expired). |
| 500 | application/problem+json | A temporary problem (unavailable); retry. |
Finish adding a passkey
Stores the new passkey; it can sign in at once. The person gets an account notice.
The registration challenge must come from a confirmed passkey addition. Until confirmations are enforced, a recent passkey sign-in also works.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused. The session needs a recent passkey: if its last passkey confirmation is more than 5 minutes old, the answer is 401 step_up_required.
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 | |
credential required | object | The passkey's answer: the PublicKeyCredential from the browser as JSON (id, rawId, type, response with binary fields as base64url; PublicKeyCredential.toJSON() gives this shape). |
{"challengeId":"chl_01J...","credential":{"id":"...","response":{},"type":"public-key"}}
Response body (JSON)
| Field | Type | Description |
|---|---|---|
ok required | true |
Responses
| Status | Body | Meaning |
|---|---|---|
| 200 | Ok | Added. |
| 400 | application/problem+json | Malformed, or the challenge is unknown, expired or used, or the passkey's answer couldn't be read (invalid). |
| 401 | application/problem+json | No session or it expired (unauthenticated), or confirm this change with your passkey (confirmation_required; until confirmations are enforced, step_up_required with action, which a passkey use in the last 5 minutes also satisfies): the answer carries the action to confirm and a short summary. |
| 403 | application/problem+json | Not allowed (forbidden); or the confirmation isn't this session's (confirmation_invalid), or an API token or assistant asked (needs_person). |
| 409 | application/problem+json | The confirmation is for a different change, or what it changes is different now (confirmation_mismatch), was already used (confirmation_used) or timed out (confirmation_expired). |
| 500 | application/problem+json | A temporary problem (unavailable); retry. |
Remove a passkey
Removes a passkey, and any copy of the person's key sealed with it. The last passkey can't be removed (the account would be unreachable). The person gets an account notice.
Needs a passkey confirmation of this change (x-k8hq-confirm: passkey.remove). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused. The session needs a recent passkey: if its last passkey confirmation is more than 5 minutes old, the answer is 401 step_up_required.
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. |
id (path) required | string | Passkey ID. |
Response body (JSON)
| Field | Type | Description |
|---|---|---|
ok required | true |
Responses
| Status | Body | Meaning |
|---|---|---|
| 200 | Ok | Removed. |
| 400 | application/problem+json | The request is malformed or a field is invalid (invalid). |
| 401 | application/problem+json | No session or it expired (unauthenticated), or confirm this change with your passkey (confirmation_required; until confirmations are enforced, step_up_required with action, which a passkey use in the last 5 minutes also satisfies): the answer carries the action to confirm and a short summary. |
| 403 | application/problem+json | Not allowed (forbidden): an assistant's delegated token, or a browser origin other than the web app's. |
| 404 | application/problem+json | No such passkey (not_found). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | It's the only passkey; add another first, or your account changed meanwhile (another passkey, session or name change won the race) and nothing was removed: reload and try again (conflict). |
| 500 | application/problem+json | A temporary problem (unavailable); retry. |