K8 HQ

Agent key bindings — K8 HQ Sign-in API

Agent key bindings 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.

Apps connected by a person prove they hold the keys K8 HQ may later share with them, and the person confirms them.

Design note 0031. Off until zero-access inboxes ship: every operation answers 404 not_found.

Base URL

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

Endpoints

Agent key bindings

Prove an app holds its keys

POST/v1/agent-key-bindings

The app returns the signed binding with the challenge digest, its signature and the opened challenge. The binding is stored pending until the person confirms it.

Parameters

NameTypeDescription
Idempotency-Key (header) requiredstring16 to 128 visible ASCII characters, new for each change.

Response body (JSON)

FieldTypeDescription
schemaVersion requiredinteger
agentSignaturestring
authorityactive | revoked
bindingobject
confirmBystringUnix seconds the person must confirm a pending binding by (24 hours, at most the connection's expiry).
displayobjectTrusted display identities from K8 HQ's records, never from the app: the app and its publisher from the app registry, the key provider (the app itself when self-hosted) and the organization's name. Only on the person's read.
fingerprintstringThe full binding fingerprint, lowercase hex.
pairingSignaturestring
pairingSignerIdstring
statepending | verified | revoked

Responses

StatusBodyMeaning
200AgentKeyBindingThe binding.
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+jsonKey sharing with apps is off (not_found), or no such binding you may see.
409application/problem+jsonThe challenge expired (challenge_expired), was already answered (conflict), or the keys are already bound (keys_bound).
422application/problem+jsonThe proof of possession didn't verify (invalid_proof).
500application/problem+jsonA temporary problem (unavailable); retry.

Start pairing an app's keys

POST/v1/agent-key-bindings/challenges

An app proposes its X25519 and Ed25519 public keys for its own connection in one organization. K8 HQ assigns the binding ID and returns a fresh challenge sealed to the X25519 key, valid 5 minutes. A public key grants nothing.

Parameters

NameTypeDescription
Idempotency-Key (header) requiredstring16 to 128 visible ASCII characters, new for each change.

Response body (JSON)

FieldTypeDescription
schemaVersion requiredinteger
agentSignaturestring
authorityactive | revoked
bindingobject
confirmBystringUnix seconds the person must confirm a pending binding by (24 hours, at most the connection's expiry).
displayobjectTrusted display identities from K8 HQ's records, never from the app: the app and its publisher from the app registry, the key provider (the app itself when self-hosted) and the organization's name. Only on the person's read.
fingerprintstringThe full binding fingerprint, lowercase hex.
pairingSignaturestring
pairingSignerIdstring
statepending | verified | revoked

Responses

StatusBodyMeaning
200AgentKeyBindingThe sealed challenge.
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+jsonKey sharing with apps is off (not_found), or no such binding you may see.
409application/problem+jsonThis pairing request has expired (challenge_expired), another pairing is waiting for confirmation, or the Idempotency-Key was used for different input (conflict).
429application/problem+jsonFour pairing requests are already waiting (rate_limited).
500application/problem+jsonA temporary problem (unavailable); retry.

Read an app's key binding

GET/v1/agent-key-bindings/{id}

The person who connected the app reads its binding: the signed fields, the fingerprint to check through a channel they trust, its confirmation deadline and who the app, provider and organization are.

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

Parameters

NameTypeDescription
id (path) requiredstringThe binding (akb_).
ownerKind (query) requiredstring
ownerId (query) requiredstring
orgId (query) requiredstring

Response body (JSON)

FieldTypeDescription
schemaVersion requiredinteger
agentSignaturestring
authorityactive | revoked
bindingobject
confirmBystringUnix seconds the person must confirm a pending binding by (24 hours, at most the connection's expiry).
displayobjectTrusted display identities from K8 HQ's records, never from the app: the app and its publisher from the app registry, the key provider (the app itself when self-hosted) and the organization's name. Only on the person's read.
fingerprintstringThe full binding fingerprint, lowercase hex.
pairingSignaturestring
pairingSignerIdstring
statepending | verified | revoked

Responses

StatusBodyMeaning
200AgentKeyBindingThe binding.
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+jsonKey sharing with apps is off (not_found), or no such binding you may see.
500application/problem+jsonA temporary problem (unavailable); retry.

Replace an app's key binding

POST/v1/agent-key-bindings/{id}/replace

The person replaces an older binding with a newer confirmed one. Keys shared with the old binding stop being available from K8 HQ; the affected inboxes need new keys for future content.

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
id (path) requiredstringThe binding (akb_).
Idempotency-Key (header) requiredstring16 to 128 visible ASCII characters, new for each change.

Response body (JSON)

FieldTypeDescription
schemaVersion requiredinteger
agentSignaturestring
authorityactive | revoked
bindingobject
confirmBystringUnix seconds the person must confirm a pending binding by (24 hours, at most the connection's expiry).
displayobjectTrusted display identities from K8 HQ's records, never from the app: the app and its publisher from the app registry, the key provider (the app itself when self-hosted) and the organization's name. Only on the person's read.
fingerprintstringThe full binding fingerprint, lowercase hex.
pairingSignaturestring
pairingSignerIdstring
statepending | verified | revoked

Responses

StatusBodyMeaning
200AgentKeyBindingThe replacement's outcome.
400application/problem+jsonThe request is malformed or a field is invalid (invalid).
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+jsonKey sharing with apps is off (not_found), or no such binding you may see.
409application/problem+jsonThe binding was already replaced by another (revoked) or the new one isn't confirmed (conflict).
500application/problem+jsonA temporary problem (unavailable); retry.

Confirm an app's key binding

POST/v1/agent-key-bindings/{id}/verify

The person signs the binding with their own key after checking its fingerprint, before its confirmation deadline.

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
id (path) requiredstringThe binding (akb_).
Idempotency-Key (header) requiredstring16 to 128 visible ASCII characters, new for each change.

Response body (JSON)

FieldTypeDescription
schemaVersion requiredinteger
agentSignaturestring
authorityactive | revoked
bindingobject
confirmBystringUnix seconds the person must confirm a pending binding by (24 hours, at most the connection's expiry).
displayobjectTrusted display identities from K8 HQ's records, never from the app: the app and its publisher from the app registry, the key provider (the app itself when self-hosted) and the organization's name. Only on the person's read.
fingerprintstringThe full binding fingerprint, lowercase hex.
pairingSignaturestring
pairingSignerIdstring
statepending | verified | revoked

Responses

StatusBodyMeaning
200AgentKeyBindingThe binding.
400application/problem+jsonThe request is malformed or a field is invalid (invalid).
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+jsonKey sharing with apps is off (not_found), or no such binding you may see.
409application/problem+jsonThe deadline passed (challenge_expired), the binding was revoked (revoked) or isn't pending (conflict).
422application/problem+jsonThe signature didn't verify with your key (invalid_proof).
500application/problem+jsonA temporary problem (unavailable); retry.