Content — K8 HQ Content API
Content operations for K8 HQ Content API. Requests, permissions and responses.
Before making requests, read the authentication and request requirements.
Read a message decrypted: its parsed content, its source and its attachments. Every read is recorded in the inbox's audit log.
Base URL
| Base URL | For |
|---|---|
https://api.k8hq.com/v1 | API tokens and the K8 HQ web app |
Endpoints
Content
Get an attachment (decrypted)
One attachment or inline part, with its content type and filename. Compatible-mode inboxes only; audited. Never cached.
For API tokens with content:read.
Parameters
| Name | Type | Description |
|---|---|---|
inbox (path) required | string | Inbox ID (ibx_…). |
msg (path) required | string | Message ID (msg_…). |
n (path) required | integer | The attachment's index from /content. |
Responses
| Status | Body | Meaning |
|---|---|---|
| 200 | */* | The attachment. |
| 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). |
Read a message (decrypted)
The message decrypted and parsed: participants, the text and HTML bodies, its attachments and inline parts (fetch each by index), and channel-specific fields (email.headers). Readable containers only (zero_access otherwise); the read is recorded in the inbox's audit log (access.content.read). Never cached.
For API tokens with content:read.
Parameters
| Name | Type | Description |
|---|---|---|
inbox (path) required | string | Inbox ID (ibx_…). |
msg (path) required | string | Message ID (msg_…). |
Response body (JSON)
| Field | Type | Description |
|---|---|---|
attachments required | Attachment[] | |
channel required | ||
flags required | Flag[] | |
html required | string | The HTML body (empty if none). Untrusted: sanitize before display. |
id required | string | |
participants required | Participant[] | |
receivedAt required | string | |
text required | string | The plain-text body (empty if none). |
email | object | Email only. |
keywords | string[] | |
spam | Spam | |
subject | string |
Responses
| Status | Body | Meaning |
|---|---|---|
| 200 | Content | The message. |
| 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). |
| 422 | application/problem+json | The message couldn't be parsed; read it whole from /source. |
| 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). |
Get a message's source (decrypted)
The whole RFC 5322 message, decrypted. Compatible-mode inboxes only; audited like /content. Never cached.
For API tokens with content:read.
Parameters
| Name | Type | Description |
|---|---|---|
inbox (path) required | string | Inbox ID (ibx_…). |
msg (path) required | string | Message ID (msg_…). |
Responses
| Status | Body | Meaning |
|---|---|---|
| 200 | message/rfc822 | The message. |
| 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). |