Notifications — K8 HQ Sign-in API
Notifications operations for K8 HQ Sign-in API. Requests, permissions and responses.
Version 1OpenAPI description (JSON)
Before making requests, read the authentication and request requirements.
Where notices are sent besides the web app (email addresses), and which kinds each destination gets.
Base URL
| Base URL | For |
https://api.k8hq.com/auth | The K8 HQ web app, and programs acting with a person's session |
Endpoints
Notifications
List notification destinations
GET/v1/account/destinations
The person's destinations, which kinds of notices are muted, and limits. Notices in K8 HQ always gets everything; destinations get copies. The first time the person can use an inbox, security notices start going to it if they're its only member; if every inbox they can use is shared, nothing is set and ask is true until they choose.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.
Response body (JSON)
| Field | Type | Description |
ask required | boolean | Every inbox the person can use is shared: ask them once whether security notices should go to one (with the warning). |
confirmationsLeft required | integer | Confirmation emails the person may still ask for today. |
destinations required | Destination[] | |
limits required | object | |
muted required | string[] | |
Responses
| Status | Body | Meaning |
| 200 | JSON | Destinations and preferences. |
| 400 | application/problem+json | The request is malformed or a field is invalid (invalid). |
| 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 destination
POST/v1/account/destinations
Copies of the person's notices also go to an inbox they can edit (at once) or to an outside address (once the code K8 HQ emails it is typed with Confirm a destination). At most 3 outside addresses and 5 confirmation emails a day. Every change is itself a security notice, copied to the destinations usable before it.
Needs a passkey confirmation of this change (x-k8hq-confirm: destination.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. |
Request body (JSON)
| Field | Type | Description |
kind required | inbox | email | |
routes required | string[] | security, account, and org:<org_id> for an organization's notices (organizations the person is in). |
address | string | |
inboxId | string | |
orgId | string | |
sharedOk | boolean | An inbox others use too: the person saw the warning in the shared_inbox answer. |
{"address":"me@example.com","kind":"email","routes":["security"]}
Response body (JSON)
| Field | Type | Description |
destination required | Destination | |
Responses
| Status | Body | Meaning |
| 200 | JSON | The new destination. |
| 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 record, or one you may not see (not_found). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | Others use this inbox (shared_inbox: show the warning in detail, then retry with sharedOk), the address asked not to be emailed (address_blocked), it's already a destination (exists), or there are as many as allowed (too_many). Inbox access changed while saving (conflict): reload and try again. 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). |
| 429 | application/problem+json | No more confirmation emails today (confirmations_limit), or destination changes (changes_limit, 20 a day). |
| 500 | application/problem+json | A temporary problem (unavailable); retry. |
Remove a destination
DELETE/v1/account/destinations/{id}
Stops copies to it. The notice about the removal still goes there, and to every other destination.
Needs a passkey confirmation of this change (x-k8hq-confirm: destination.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 | Resource 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 record, or one you may not see (not_found). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 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). |
| 429 | application/problem+json | No more destination changes today (changes_limit, 20 a day). |
| 500 | application/problem+json | A temporary problem (unavailable); retry. |
Change what a destination gets
PUT/v1/account/destinations/{id}/routes
Sets the kinds of notices copied there. For an inbox K8 HQ put on hold because others now use it, sharedOk releases it.
Replaces the complete routes array. Supply every value to retain. You need permission to edit an inbox to change which notices go there.
Needs a passkey confirmation of this change (x-k8hq-confirm: destination.routes). 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 | Resource ID. |
Request body (JSON)
| Field | Type | Description |
routes required | string[] | security, account, and org:<org_id> for an organization's notices (organizations the person is in). |
sharedOk | boolean | |
{"routes":["security","account"]}
Response body (JSON)
| Field | Type | Description |
destination required | Destination | |
Responses
| Status | Body | Meaning |
| 200 | JSON | The changed destination. |
| 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 record, or one you may not see (not_found). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | Others use this inbox (shared_inbox): retry with sharedOk. Inbox access changed while saving (conflict): reload and try again. 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). |
| 429 | application/problem+json | No more destination changes today (changes_limit, 20 a day). |
| 500 | application/problem+json | A temporary problem (unavailable); retry. |
Mute kinds of notices
PUT/v1/account/notice-preferences
Kinds of notices copied to no destination (they're still in Notices): account, or org:<org_id> for an organization's. Security notices can't be muted. Replaces the list.
Replaces the complete muted array. Supply every value to retain.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.
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 |
muted required | string[] | |
{"muted":["account"]}
Response body (JSON)
| Field | Type | Description |
muted required | string[] | |
ok required | true | |
Responses
| Status | Body | Meaning |
| 200 | JSON | The muted kinds. |
| 400 | application/problem+json | The request is malformed or a field is invalid (invalid). |
| 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. |
Keep notices in Notices only
POST/v1/destinations/ask/dismiss
The person chose not to send security notices to a shared inbox: ask turns false.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.
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 |
ok required | true | |
Responses
| Status | Body | Meaning |
| 200 | Ok | Done. |
| 400 | application/problem+json | The request is malformed or a field is invalid (invalid). |
| 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. |
| 500 | application/problem+json | A temporary problem (unavailable); retry. |
Confirm a destination
POST/v1/destinations/confirm
Checks the 6-digit code K8 HQ emailed an outside address (7 days, the newest one only, 5 tries) and starts sending copies there. Codes are typed here, signed in: confirmation emails carry no link that confirms.
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 |
code required | string | |
id required | string | |
{"code":"123456","id":"dst_01J..."}
Response body (JSON)
| Field | Type | Description |
destination required | Destination | |
Responses
| Status | Body | Meaning |
| 200 | JSON | The confirmed destination. |
| 400 | application/problem+json | Bad request, or the code isn't right (wrong_code). |
| 401 | application/problem+json | No session or it expired (unauthenticated), or its passkey confirmation is more than 5 minutes old (step_up_required). |
| 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 record, or one you may not see (not_found). |
| 409 | application/problem+json | It isn't waiting for a code (not_pending). |
| 410 | application/problem+json | The code has expired (code_expired): send a new one. |
| 429 | application/problem+json | Too many wrong codes (too_many_tries): send a new one; or no more destination changes today (changes_limit). |
| 500 | application/problem+json | A temporary problem (unavailable); retry. |
Send a new code
POST/v1/destinations/resend
Emails a pending address a new code; earlier codes stop working. Counts against the 5 confirmation emails a day.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.
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 |
id required | string | |
{"id":"dst_01J..."}
Response body (JSON)
| Field | Type | Description |
confirmationsLeft required | integer | |
ok required | true | |
Responses
| Status | Body | Meaning |
| 200 | JSON | Sent (within a minute). |
| 400 | application/problem+json | The request is malformed or a field is invalid (invalid). |
| 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. |
| 404 | application/problem+json | No such record, or one you may not see (not_found). |
| 409 | application/problem+json | It isn't waiting for a code (not_pending). |
| 429 | application/problem+json | No more confirmation emails today (confirmations_limit). |
| 500 | application/problem+json | A temporary problem (unavailable); retry. |
Stop emails to an address
POST/v1/destinations/stop
The "this wasn't me" link in a confirmation email (https://app.k8hq.com/n/stop/<token>), needing no sign-in: K8 HQ won't email the address again, for any account, and its person is told.
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 |
token required | string | |
{"token":"dst_01J...-1-..."}
Response body (JSON)
| Field | Type | Description |
ok required | true | |
Responses
| Status | Body | Meaning |
| 200 | Ok | Stopped. |
| 400 | application/problem+json | The request is malformed or a field is invalid (invalid). |
| 404 | application/problem+json | Not a link K8 HQ sent, or it was changed (not_found). |
| 500 | application/problem+json | A temporary problem (unavailable); retry. |