Contacts — K8 HQ Setup API
Contacts operations for K8 HQ Setup API. Requests, permissions and responses.
Version 1OpenAPI description (JSON)
Before making requests, read the authentication and request requirements.
Organization-owned contact books and membership.
Base URL
| Base URL | For |
https://api.k8hq.com/setup | The 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
| 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). |
Request body (JSON)
| Field | Type | Description |
bookId required | string | |
orgId required | string | |
Response body (JSON)
| Field | Type | Description |
bookId required | string | |
Responses
| Status | Body | Meaning |
| 200 | JSON | Cancel book removal before purge begins. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No 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). |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 404 | application/problem+json | The organization is outside this connection, or the target does not exist. |
| 409 | application/problem+json | The book changed or its lifecycle prevents this action. |
| 412 | application/problem+json | The book changed or its lifecycle prevents this action. |
| 503 | application/problem+json | A 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
| 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). |
orgId (path) required | string | Organization ID. |
Idempotency-Key (header) | string | Required 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)
Response body (JSON)
Responses
| Status | Body | Meaning |
| 200 | JSON | Create an organization-owned contact book. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No 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). |
| 402 | application/problem+json | The organization cannot add resources now. The existing generic failure helper may return unavailable at this status; use the HTTP status as well. |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 404 | application/problem+json | The organization is outside this connection, or the target does not exist. |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | The book changed or its lifecycle prevents this action. |
| 412 | application/problem+json | The book changed or its lifecycle prevents this action. |
| 422 | application/problem+json | The 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. |
| 503 | application/problem+json | A 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
| Name | Type | Description |
orgId (path) required | string | orgId resource identifier. |
bookId (path) required | string | bookId resource identifier. |
Response body (JSON)
| Field | Type | Description |
access required | object[] | Each member's access: owner ("Can edit") or read ("Can view"). |
book required | object | |
canDelete required | boolean | |
canRename required | boolean | |
canShare required | boolean | |
enabled required | boolean | |
memberId required | string | |
members required | string[] | |
Responses
| Status | Body | Meaning |
| 200 | JSON | Read a contact book and current capabilities. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No session, it expired, or it isn't a person's own session (unauthenticated). |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | The book changed or its lifecycle prevents this action. |
| 412 | application/problem+json | The book changed or its lifecycle prevents this action. |
| 503 | application/problem+json | A 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
| 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). |
orgId (path) required | string | orgId resource identifier. |
bookId (path) required | string | bookId resource identifier. |
Request body (JSON)
| Field | Type | Description |
name required | string | |
version required | integer | |
Response body (JSON)
| Field | Type | Description |
bookId required | string | |
Responses
| Status | Body | Meaning |
| 200 | JSON | Rename a book with optimistic concurrency. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No session, it expired, or it isn't a person's own session (unauthenticated). |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | The book changed or its lifecycle prevents this action. |
| 412 | application/problem+json | The book changed or its lifecycle prevents this action. |
| 503 | application/problem+json | A 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
| 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). |
orgId (path) required | string | orgId resource identifier. |
bookId (path) required | string | bookId resource identifier. |
x-k8hq-delete-confirm (header) | string | Exact 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) | string | Required 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)
Response body (JSON)
Responses
| Status | Body | Meaning |
| 200 | JSON | Schedule book removal with seven-day cancelable grace. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No 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). |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 404 | application/problem+json | The organization is outside this connection, or the target does not exist. |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | The book changed or its lifecycle prevents this action. |
| 412 | application/problem+json | The book changed or its lifecycle prevents this action. |
| 503 | application/problem+json | A 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
| 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). |
orgId (path) required | string | orgId resource identifier. |
bookId (path) required | string | bookId resource identifier. |
Request body (JSON)
| Field | Type | Description |
memberId required | string | |
role | owner | read | owner ("Can edit", the default) or read ("Can view"). |
Response body (JSON)
| Field | Type | Description |
bookId required | string | |
Responses
| Status | Body | Meaning |
| 200 | JSON | Give a member book access. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No 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). |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | The book changed or its lifecycle prevents this action. |
| 412 | application/problem+json | The book changed or its lifecycle prevents this action. |
| 503 | application/problem+json | A 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
| 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). |
orgId (path) required | string | orgId resource identifier. |
bookId (path) required | string | bookId resource identifier. |
memberId (path) required | string | memberId resource identifier. |
Response body (JSON)
| Field | Type | Description |
bookId required | string | |
Responses
| Status | Body | Meaning |
| 200 | JSON | Revoke book access while protecting owners and the last holder. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No 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). |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | The book changed or its lifecycle prevents this action. |
| 412 | application/problem+json | The book changed or its lifecycle prevents this action. |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |