K8 HQ

Contacts — K8 HQ Setup API

Contacts operations for K8 HQ Setup API. Requests, permissions and responses.

Version 1OpenAPI description (JSON)

Browse operation groups

Before making requests, read the authentication and request requirements.

Organization-owned contact books and membership.

Base URL

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

Endpoints

Contacts

Cancel book removal before purge begins

POST/v1/books/delete/cancel

Cancel book removal before purge begins. Reads and exports remain available while Contacts is disabled or removal is pending. Books are organization-owned. Shared creation, sharing changes and removal require a recent passkey.

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

Request body (JSON)

FieldTypeDescription
bookId requiredstring
orgId requiredstring

Response body (JSON)

FieldTypeDescription
bookId requiredstring

Responses

StatusBodyMeaning
200JSONCancel book removal before purge begins.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (step_up_required).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
404application/problem+jsonThe organization is outside this connection, or the target does not exist.
409application/problem+jsonThe book changed or its lifecycle prevents this action.
412application/problem+jsonThe book changed or its lifecycle prevents this action.
503application/problem+jsonA temporary problem (unavailable); retry.

Create an organization-owned contact book

POST/v1/organizations/{orgId}/books

Create an organization-owned contact book. Reads and exports remain available while Contacts is disabled or removal is pending. Books are organization-owned. Shared creation, sharing changes and removal require a recent passkey.

Personal agent contract (conditional). Create an organization-owned contact book. Members normalize to the authorizing member alone for self (books.create), or to any other member set for shared (containers.create and unattended acknowledgment). The server chooses the book ID and commits the initial grants with creation; it returns bookId, not a book object. Required header: Idempotency-Key (16 to 128 visible ASCII characters). Success returns operation-id; keep the same key and input to retry. Current access is checked again on every retry. The service requires explicit operator activation. Action setup.createBookResource.self (self). Permissions: books.create. Unattended-risk acknowledgment: not required. Receipt: atomic-book-create-self-v1. Status fields: id, action, state, resources.organizationId, resources.bookId. Action setup.createBookResource.shared (shared). Permissions: containers.create. Unattended-risk acknowledgment: required. Receipt: atomic-book-create-shared-v1. Status fields: id, action, state, resources.organizationId, resources.bookId. Agent input: AgentBookInput. Agent result: AgentBookResult.

For a person's own session (x-k8hq-token), or personal agent credentials (Authorization: Bearer) when enabled.

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).
orgId (path) requiredstringOrganization ID.
Idempotency-Key (header)stringRequired for personal agent credentials: 16 to 128 visible ASCII characters. A session does not need this header. Keep the exact key and input when retrying after an unknown reply.

Request body (JSON)

FieldTypeDescription
Alternative 1SessionCreateBookResourceInputSessionCreateBookResourceInput
Alternative 2AgentBookInputAgentBookInput

Response body (JSON)

FieldTypeDescription
Alternative 1SessionCreateBookResourceResultSessionCreateBookResourceResult
Alternative 2AgentBookResultAgentBookResult

Responses

StatusBodyMeaning
200JSONCreate an organization-owned contact book.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (step_up_required).
402application/problem+jsonThe organization cannot add resources now. The existing generic failure helper may return unavailable at this status; use the HTTP status as well.
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
404application/problem+jsonThe organization is outside this connection, or the target does not exist.
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonThe book changed or its lifecycle prevents this action.
412application/problem+jsonThe book changed or its lifecycle prevents this action.
422application/problem+jsonThe command does not meet the action limits or current requirements. The existing generic failure helper may return unavailable at this status; use the HTTP status as well.
503application/problem+jsonA temporary problem (unavailable); retry.

Read a contact book and current capabilities

GET/v1/organizations/{orgId}/books/{bookId}

Read a contact book and current capabilities. Reads and exports remain available while Contacts is disabled or removal is pending. Books are organization-owned. Shared creation, sharing changes and removal require a recent passkey.

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

Parameters

NameTypeDescription
orgId (path) requiredstringorgId resource identifier.
bookId (path) requiredstringbookId resource identifier.

Response body (JSON)

FieldTypeDescription
access requiredobject[]Each member's access: owner ("Can edit") or read ("Can view").
book requiredobject
canDelete requiredboolean
canRename requiredboolean
canShare requiredboolean
enabled requiredboolean
memberId requiredstring
members requiredstring[]

Responses

StatusBodyMeaning
200JSONRead a contact book and current capabilities.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonThe book changed or its lifecycle prevents this action.
412application/problem+jsonThe book changed or its lifecycle prevents this action.
503application/problem+jsonA temporary problem (unavailable); retry.

Rename a book with optimistic concurrency

PATCH/v1/organizations/{orgId}/books/{bookId}

Rename a book with optimistic concurrency. Reads and exports remain available while Contacts is disabled or removal is pending. Books are organization-owned. Shared creation, sharing changes and removal require a recent passkey.

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).
orgId (path) requiredstringorgId resource identifier.
bookId (path) requiredstringbookId resource identifier.

Request body (JSON)

FieldTypeDescription
name requiredstring
version requiredinteger

Response body (JSON)

FieldTypeDescription
bookId requiredstring

Responses

StatusBodyMeaning
200JSONRename a book with optimistic concurrency.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonThe book changed or its lifecycle prevents this action.
412application/problem+jsonThe book changed or its lifecycle prevents this action.
503application/problem+jsonA temporary problem (unavailable); retry.

Schedule book removal with seven-day cancelable grace

DELETE/v1/organizations/{orgId}/books/{bookId}

Schedule book removal with seven-day cancelable grace. Reads and exports remain available while Contacts is disabled or removal is pending. Books are organization-owned. Shared creation, sharing changes and removal require a recent passkey.

Needs a passkey confirmation of this change (x-k8hq-confirm: container.delete). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.

Personal agent contract (conditional). Schedule removal of the exact book. The committed receipt is scheduling acceptance, not current pending state or purge completion. The system continues after app disconnection; the existing human cancellation path remains available during the grace period. Required header: Idempotency-Key (16 to 128 visible ASCII characters). Success returns operation-id; keep the same key and input to retry. Current access is checked again on every retry. The service requires explicit operator activation. Action setup.deleteBookResource. Permissions: containers.delete. Unattended-risk acknowledgment: required. Receipt: book-removal-v1. Status fields: id, action, state, resources.bookId. Agent input: AgentConfirmationInput. Agent result: AgentRemovalReceipt.

For a person's own session (x-k8hq-token), or personal agent credentials (Authorization: Bearer) when enabled.

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).
orgId (path) requiredstringorgId resource identifier.
bookId (path) requiredstringbookId resource identifier.
x-k8hq-delete-confirm (header)stringExact typed confirmation, UTF-8 percent-encoded (encodeURIComponent), decoded once; maximum 4096 encoded bytes. Use a bodyless DELETE. Input metadata, not authorization. Do not combine deletion headers with any body. JSON bodies remain supported for direct requests.
Idempotency-Key (header)stringRequired for personal agent credentials: 16 to 128 visible ASCII characters. A session does not need this header. Keep the exact key and input when retrying after an unknown reply.

Request body (JSON)

FieldTypeDescription
Alternative 1SessionDeleteBookResourceInputSessionDeleteBookResourceInput
Alternative 2AgentConfirmationInputAgentConfirmationInput

Response body (JSON)

FieldTypeDescription
Alternative 1SessionDeleteBookResourceResultSessionDeleteBookResourceResult
Alternative 2AgentRemovalReceiptAgentRemovalReceipt

Responses

StatusBodyMeaning
200JSONSchedule book removal with seven-day cancelable grace.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (step_up_required).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
404application/problem+jsonThe organization is outside this connection, or the target does not exist.
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonThe book changed or its lifecycle prevents this action.
412application/problem+jsonThe book changed or its lifecycle prevents this action.
503application/problem+jsonA temporary problem (unavailable); retry.

Give a member book access

POST/v1/organizations/{orgId}/books/{bookId}/members

Give a member book access, or change the access of a member who has it. "Can edit" is the default; "Can view" lets them read and export contacts but not change, share or rename the book (deleting it still depends on containers.delete). A book keeps at least one member who can edit it. Reads and exports remain available while Contacts is disabled or removal is pending. Books are organization-owned. Shared creation, sharing changes and removal require a recent passkey.

Needs a passkey confirmation of this change (x-k8hq-confirm: access.grant). 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.

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).
orgId (path) requiredstringorgId resource identifier.
bookId (path) requiredstringbookId resource identifier.

Request body (JSON)

FieldTypeDescription
memberId requiredstring
roleowner | readowner ("Can edit", the default) or read ("Can view").

Response body (JSON)

FieldTypeDescription
bookId requiredstring

Responses

StatusBodyMeaning
200JSONGive a member book access.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (step_up_required).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonThe book changed or its lifecycle prevents this action.
412application/problem+jsonThe book changed or its lifecycle prevents this action.
503application/problem+jsonA temporary problem (unavailable); retry.

Revoke book access while protecting owners and the last holder

DELETE/v1/organizations/{orgId}/books/{bookId}/members/{memberId}

Revoke book access while protecting owners and the last holder. Reads and exports remain available while Contacts is disabled or removal is pending. Books are organization-owned. Shared creation, sharing changes and removal require a recent passkey.

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).
orgId (path) requiredstringorgId resource identifier.
bookId (path) requiredstringbookId resource identifier.
memberId (path) requiredstringmemberId resource identifier.

Response body (JSON)

FieldTypeDescription
bookId requiredstring

Responses

StatusBodyMeaning
200JSONRevoke book access while protecting owners and the last holder.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (step_up_required).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonThe book changed or its lifecycle prevents this action.
412application/problem+jsonThe book changed or its lifecycle prevents this action.
503application/problem+jsonA temporary problem (unavailable); retry.