K8 HQ

Notifications — K8 HQ Sign-in API

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

Where notices are sent besides the web app (email addresses), and which kinds each destination gets.

Base URL

Base URLFor
https://api.k8hq.com/authThe 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)

FieldTypeDescription
ask requiredbooleanEvery inbox the person can use is shared: ask them once whether security notices should go to one (with the warning).
confirmationsLeft requiredintegerConfirmation emails the person may still ask for today.
destinations requiredDestination[]
limits requiredobject
muted requiredstring[]

Responses

StatusBodyMeaning
200JSONDestinations and preferences.
400application/problem+jsonThe request is malformed or a field is invalid (invalid).
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.

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

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
kind requiredinbox | email
routes requiredstring[]security, account, and org:<org_id> for an organization's notices (organizations the person is in).
addressstring
inboxIdstring
orgIdstring
sharedOkbooleanAn 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)

FieldTypeDescription
destination requiredDestination

Responses

StatusBodyMeaning
200JSONThe new destination.
400application/problem+jsonThe request is malformed or a field is invalid (invalid).
401application/problem+jsonNo 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.
403application/problem+jsonNot allowed (forbidden): an assistant's delegated token, or a browser origin other than the web app's.
404application/problem+jsonNo such record, or one you may not see (not_found).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonOthers 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).
429application/problem+jsonNo more confirmation emails today (confirmations_limit), or destination changes (changes_limit, 20 a day).
500application/problem+jsonA 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

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.
id (path) requiredstringResource ID.

Response body (JSON)

FieldTypeDescription
ok requiredtrue

Responses

StatusBodyMeaning
200OkRemoved.
400application/problem+jsonThe request is malformed or a field is invalid (invalid).
401application/problem+jsonNo 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.
403application/problem+jsonNot allowed (forbidden): an assistant's delegated token, or a browser origin other than the web app's.
404application/problem+jsonNo such record, or one you may not see (not_found).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonThe 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).
429application/problem+jsonNo more destination changes today (changes_limit, 20 a day).
500application/problem+jsonA 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

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.
id (path) requiredstringResource ID.

Request body (JSON)

FieldTypeDescription
routes requiredstring[]security, account, and org:<org_id> for an organization's notices (organizations the person is in).
sharedOkboolean
{"routes":["security","account"]}

Response body (JSON)

FieldTypeDescription
destination requiredDestination

Responses

StatusBodyMeaning
200JSONThe changed destination.
400application/problem+jsonThe request is malformed or a field is invalid (invalid).
401application/problem+jsonNo 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.
403application/problem+jsonNot allowed (forbidden): an assistant's delegated token, or a browser origin other than the web app's.
404application/problem+jsonNo such record, or one you may not see (not_found).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonOthers 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).
429application/problem+jsonNo more destination changes today (changes_limit, 20 a day).
500application/problem+jsonA 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

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
muted requiredstring[]
{"muted":["account"]}

Response body (JSON)

FieldTypeDescription
muted requiredstring[]
ok requiredtrue

Responses

StatusBodyMeaning
200JSONThe muted kinds.
400application/problem+jsonThe request is malformed or a field is invalid (invalid).
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.

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

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.
{}

Response body (JSON)

FieldTypeDescription
ok requiredtrue

Responses

StatusBodyMeaning
200OkDone.
400application/problem+jsonThe request is malformed or a field is invalid (invalid).
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.
500application/problem+jsonA 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

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 requiredstring
id requiredstring
{"code":"123456","id":"dst_01J..."}

Response body (JSON)

FieldTypeDescription
destination requiredDestination

Responses

StatusBodyMeaning
200JSONThe confirmed destination.
400application/problem+jsonBad request, or the code isn't right (wrong_code).
401application/problem+jsonNo session or it expired (unauthenticated), or its passkey confirmation is more than 5 minutes old (step_up_required).
403application/problem+jsonNot allowed (forbidden): an assistant's delegated token, or a browser origin other than the web app's.
404application/problem+jsonNo such record, or one you may not see (not_found).
409application/problem+jsonIt isn't waiting for a code (not_pending).
410application/problem+jsonThe code has expired (code_expired): send a new one.
429application/problem+jsonToo many wrong codes (too_many_tries): send a new one; or no more destination changes today (changes_limit).
500application/problem+jsonA 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

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
id requiredstring
{"id":"dst_01J..."}

Response body (JSON)

FieldTypeDescription
confirmationsLeft requiredinteger
ok requiredtrue

Responses

StatusBodyMeaning
200JSONSent (within a minute).
400application/problem+jsonThe request is malformed or a field is invalid (invalid).
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.
404application/problem+jsonNo such record, or one you may not see (not_found).
409application/problem+jsonIt isn't waiting for a code (not_pending).
429application/problem+jsonNo more confirmation emails today (confirmations_limit).
500application/problem+jsonA 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

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
token requiredstring
{"token":"dst_01J...-1-..."}

Response body (JSON)

FieldTypeDescription
ok requiredtrue

Responses

StatusBodyMeaning
200OkStopped.
400application/problem+jsonThe request is malformed or a field is invalid (invalid).
404application/problem+jsonNot a link K8 HQ sent, or it was changed (not_found).
500application/problem+jsonA temporary problem (unavailable); retry.