Search settings — K8 HQ Content API
Search settings operations for K8 HQ Content API. Requests, permissions and responses.
Version 1OpenAPI description (JSON)
Before making requests, read the authentication and request requirements.
Configure semantic search for an inbox.
Base URL
| Base URL | For |
https://api.k8hq.com/v1 | API tokens and the K8 HQ web app |
Endpoints
Search settings
Get the mailbox's search by meaning
GET/inboxes/{inbox}/semantic
Search by meaning (semantic search) finds messages about what you typed even when they don't share its words. It's opt-in per mailbox and paid by the organization: each message's subject, text and attachment names and types (never attachment contents, at most about 8,000 tokens) are sent to an embedding model (Amazon Titan Text Embeddings v2 on AWS Bedrock, in K8 HQ's region; AWS keeps nothing and trains on nothing), and the resulting vectors are stored encrypted with the mailbox's key and deleted with it. Zero-access mailboxes can't be searched by meaning on the server. Shows the mailbox's setting and the organization's, whether it's on, how far its index is, and (when it's off or still building) what turning it on would cost now. Everyone with access to the inbox sees it.
For API tokens with messages:read and the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
estimate (query) | 0 | 0 leaves the estimate out (it reads every message's size). |
Response body (JSON)
| Field | Type | Description |
forbidden required | boolean | |
mayChange required | boolean | |
mode required | org | on | off | The mailbox's setting: org follows the organization's default. |
model required | string | The embedding model. |
note required | string | What this means, for people. |
off required | | off | forbidden | zero_access | removed | Why it isn't on: off (its setting, or the organization's default), forbidden (an owner forbade sending message text to AI models), zero_access, removed; empty when on. |
on required | boolean | Whether the mailbox is searchable by meaning (its mail is embedded as it arrives). |
orgDefault required | boolean | |
prices required | SemanticPrices | |
status required | SemanticStatus | |
zeroAccess required | boolean | |
estimate | SemanticEstimate | |
estimatePending | boolean | The mailbox is still loading for the estimate: ask again in a moment. |
Responses
| Status | Body | Meaning |
| 200 | SemanticSettings | The mailbox's search by meaning. |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Turn the mailbox's search by meaning on or off
PUT/inboxes/{inbox}/semantic
mode: org (follow the organization's default), on or off. When that turns it on, the existing mail is embedded once at the estimate's cost: send its total as confirm (409 confirm_estimate with the estimate otherwise), and the organization's credit must cover it (402). New mail is then embedded as it arrives, billed as it goes. Turning it off deletes the mailbox's vectors. People with inbox.settings.change for the inbox, signed in to the web app with a passkey used in the last 5 minutes (401 step_up_required otherwise). Recorded as inbox.setting_changed (semanticSearch). An estimate more than what's left of the organization's monthly limit is refused (409).
For the web app. 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 |
inbox (path) required | string | Inbox ID (ibx_…). |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Request body (JSON)
| Field | Type | Description |
mode required | org | on | off | |
confirm | string | The estimate's total you agree to, as shown. |
Response body (JSON)
| Field | Type | Description |
forbidden required | boolean | |
mayChange required | boolean | |
mode required | org | on | off | The mailbox's setting: org follows the organization's default. |
model required | string | The embedding model. |
note required | string | What this means, for people. |
off required | | off | forbidden | zero_access | removed | Why it isn't on: off (its setting, or the organization's default), forbidden (an owner forbade sending message text to AI models), zero_access, removed; empty when on. |
on required | boolean | Whether the mailbox is searchable by meaning (its mail is embedded as it arrives). |
orgDefault required | boolean | |
prices required | SemanticPrices | |
status required | SemanticStatus | |
zeroAccess required | boolean | |
estimate | SemanticEstimate | |
estimatePending | boolean | The mailbox is still loading for the estimate: ask again in a moment. |
Responses
| Status | Body | Meaning |
| 200 | SemanticSettings | Saved. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 402 | application/problem+json | The estimate is more than the organization's credit (out_of_credit). Or the organization is read-only (read_only): out of credit for 60 days, so nothing can be changed until an owner adds credit. |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | JSON, application/problem+json | Turning it on needs the estimate confirmed (confirm_estimate): send its total as confirm. Or another change of the same Idempotency-Key is still running, or the mailbox can't be searched by meaning (zero-access, forbidden). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |