Folders and recovery — K8 HQ Content API
Folders and recovery operations for K8 HQ Content API. Requests, permissions and responses.
Version 1OpenAPI description (JSON)
Before making requests, read the authentication and request requirements.
Manage folders, recover removed messages, and move a sender’s existing mail with Undo.
Base URL
| Base URL | For |
https://api.k8hq.com/v1 | API tokens and the K8 HQ web app |
Endpoints
Folders and recovery
List labels
GET/inboxes/{inbox}/labels
The inbox's labels (folders in a mail app): INBOX first, then special-use labels (Sent, Drafts, Trash, Spam, Archive), then the rest by name. A message can carry several labels. Labels people create can be renamed and deleted; system labels can't.
For API tokens with messages:read and the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
Response body (JSON)
| Field | Type | Description |
labels required | Label[] | |
Responses
| Status | Body | Meaning |
| 200 | JSON | The labels. |
| 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). |
Create a label
POST/inboxes/{inbox}/labels
Creates an empty label (a folder in mail apps, which see it at once). File messages into it with Move or label a message. An inbox can have up to 100 labels besides the system ones. The name stays out of events: label.created carries only the ID. Creating a folder requires edit access to the inbox.
For API tokens with messages:write and the web app.
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 |
name required | string | Unique in the inbox, ignoring case. / may separate levels, as mail apps show them (Work/2026); INBOX is reserved. |
{"name":"Receipts"}
Response body (JSON)
| Field | Type | Description |
id required | string | |
name required | string | |
total required | integer | |
unread required | integer | |
converting | boolean | This folder is being turned into a tag. |
specialUse | \Sent | \Drafts | \Trash | \Junk | \Archive | The label's role, as IMAP names it. |
Responses
| Status | Body | Meaning |
| 201 | Label | The new label. |
| 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 organization is read-only (read_only, design note 0024): it has been 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 | application/problem+json | The inbox already has a label with that name (conflict), or the same Idempotency-Key is still running (in_progress). If access changed while saving (conflict), reload and try again. |
| 422 | application/problem+json | The inbox has the most labels allowed (rejected). |
| 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). |
Rename a label
PATCH/inboxes/{inbox}/labels/{label}
Renames a label people created; its messages stay in it. System labels (INBOX, Sent, Drafts, Trash, Spam, Archive) can't be renamed. Renaming a folder requires edit access to the inbox.
For API tokens with messages:write and the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
label (path) required | string | Label ID (lbl_…). |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Request body (JSON)
| Field | Type | Description |
name required | string | Unique in the inbox, ignoring case. / may separate levels, as mail apps show them (Work/2026); INBOX is reserved. |
{"name":"Receipts"}
Response body (JSON)
| Field | Type | Description |
id required | string | |
name required | string | |
total required | integer | |
unread required | integer | |
converting | boolean | This folder is being turned into a tag. |
specialUse | \Sent | \Drafts | \Trash | \Junk | \Archive | The label's role, as IMAP names it. |
Responses
| Status | Body | Meaning |
| 200 | Label | The renamed label. |
| 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 organization is read-only (read_only, design note 0024): it has been 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 | application/problem+json | Another label has that name (conflict), or the same Idempotency-Key is still running (in_progress). If access changed while saving (conflict), reload and try again. |
| 422 | application/problem+json | A system label (rejected). |
| 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). |
Delete a label
DELETE/inboxes/{inbox}/labels/{label}
Takes every message out of the label (each a message.unlabeled event), then deletes it (label.deleted). Messages stay in their other labels; a message in no other label moves to Archive (message.moved): messages never end up in no folder. The folder is hidden as soon as deletion starts. A label with many messages answers 202 and finishes in the background; deleting it again resumes a delete that was cut off. System labels can't be deleted. Deleting a folder requires edit access to the inbox. If access changes after deletion starts, the folder stays hidden and an editor can finish by deleting it again.
For API tokens with messages:write and the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
label (path) required | string | Label ID (lbl_…). |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Response body (JSON)
| Field | Type | Description |
id required | string | |
status required | deleting | |
Responses
| Status | Body | Meaning |
| 202 | JSON | Still taking messages out of the label; it finishes in the background. |
| 204 | | Deleted. |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 402 | application/problem+json | The organization is read-only (read_only, design note 0024): it has been 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 | application/problem+json | Access changed while saving (conflict). Reload and try again. A request with the same Idempotency-Key may also still be running (in_progress). |
| 422 | application/problem+json | A system label (rejected). |
| 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). |
Delete messages forever
POST/inboxes/{inbox}/labels/{label}/delete-forever
Deletes chosen messages in the inbox's Trash or Spam for good, at once. Messages not in the folder are skipped. The folder: the inbox's Trash or Spam (422 rejected for any other). People only: a person signed in to the web app, never an access token (403; programs delete for good with a mail app's EXPUNGE in Trash over IMAP) or an assistant (403). Edit access to the inbox or form is required. Needs a passkey used in the last 5 minutes (401 step_up_required); per-action confirmation (design note 0013, kind trash.empty) replaces that when it ships. A message is deleted for good only while this folder is its one label, checked again at the moment it's deleted: a message also in another folder (or filed in one meanwhile) only leaves this one and stays there. Each deletion is a message.deleted event (mode purged, with a reason) and is billed as messages.purged; storage goes down. Final: unlike emptying, a message deleted forever can't be recovered (/recoverable). Deleted mail leaves K8 HQ's backups within about 6 weeks. Works the same in zero-access inboxes (nothing is decrypted).
For the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
label (path) required | string | Label ID (lbl_…). |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Request body (JSON)
| Field | Type | Description |
messages required | string[] | The messages (msg_), up to 100. |
{"messages":["msg_01J9Z3Q4W5E6R7T8Y9U0I1O2P3"]}
Response body (JSON)
| Field | Type | Description |
kept required | integer | Also in another folder: they only left this one. |
purged required | integer | Deleted for good. |
skipped required | integer | Not in this folder (or changed meanwhile). |
Responses
| Status | Body | Meaning |
| 200 | JSON | What happened to them. |
| 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 organization is read-only (read_only, design note 0024): it has been 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 | application/problem+json | The request stops if access changes (conflict). If some messages were already deleted or removed from the folder, applied gives their count. A request with the same Idempotency-Key may also still be running (in_progress). |
| 422 | application/problem+json | Not Trash or Spam (rejected). |
| 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). |
Empty Trash or Spam
POST/inboxes/{inbox}/labels/{label}/empty
Deletes for good everything in the inbox's Trash or Spam when asked (not mail that arrives meanwhile), in the background: poll the job for progress. Asking again before anything new arrives returns the same job. The folder: the inbox's Trash or Spam (422 rejected for any other). People only: a person signed in to the web app, never an access token (403; programs delete for good with a mail app's EXPUNGE in Trash over IMAP) or an assistant (403). Edit access to the inbox or form is required. Needs a passkey used in the last 5 minutes (401 step_up_required); per-action confirmation (design note 0013, kind trash.empty) replaces that when it ships. A message is deleted for good only while this folder is its one label, checked again at the moment it's deleted: a message also in another folder (or filed in one meanwhile) only leaves this one and stays there. Each deletion is a message.deleted event (mode purged, with a reason) and is billed as messages.purged. For 35 days the people with access to the inbox can recover what was deleted (GET /inboxes/{inbox}/recoverable); its storage is billed until then, and then it leaves K8 HQ's backups within about 6 weeks. Works the same in zero-access inboxes (nothing is decrypted).
For the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
label (path) required | string | Label ID (lbl_…). |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Response body (JSON)
| Field | Type | Description |
createdAt required | string | |
id required | string | The job (job_). |
kept required | integer | Also in another folder: they only left this one. |
purged required | integer | Deleted for good so far. |
skipped required | integer | Not in the folder any more when their turn came (moved, restored or deleted meanwhile). |
status required | queued | running | waiting | succeeded | failed | cancelled | waiting: a step failed and is retried shortly; failed: stopped for good (for example, the person lost access to the inbox). |
total required | integer | How many messages the folder held when asked (for a progress bar). |
finishedAt | string | |
Responses
| Status | Body | Meaning |
| 202 | EmptyFolderJob | Emptying started (or already under way). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 402 | application/problem+json | The organization is read-only (read_only, design note 0024): it has been 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 | application/problem+json | Access changed while saving (conflict). Reload and try again. A request with the same Idempotency-Key may also still be running (in_progress). |
| 422 | application/problem+json | Not Trash or Spam (rejected). |
| 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 an emptying's progress
GET/inboxes/{inbox}/labels/{label}/empty/{job}
How far emptying Trash or Spam has got. People only, as for emptying (403 for tokens and assistants).
For the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
label (path) required | string | Label ID (lbl_…). |
job (path) required | string | The emptying job (job_). |
Response body (JSON)
| Field | Type | Description |
createdAt required | string | |
id required | string | The job (job_). |
kept required | integer | Also in another folder: they only left this one. |
purged required | integer | Deleted for good so far. |
skipped required | integer | Not in the folder any more when their turn came (moved, restored or deleted meanwhile). |
status required | queued | running | waiting | succeeded | failed | cancelled | waiting: a step failed and is retried shortly; failed: stopped for good (for example, the person lost access to the inbox). |
total required | integer | How many messages the folder held when asked (for a progress bar). |
finishedAt | string | |
Responses
| Status | Body | Meaning |
| 200 | EmptyFolderJob | The emptying. |
| 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 | Not Trash or Spam (rejected). |
| 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 a folder into a tag
POST/inboxes/{inbox}/labels/{label}/tag
Adds an organization tag to every message in a folder, moves each back to Inbox, then deletes the empty folder. People who manage the inbox only, checked afresh at the start and at every step. Access tokens and assistants cannot start a conversion. Create or choose the tag first; the body names its ID. Starting is refused with 409 folder_rules while any rule files into the folder, including paused rules and app rules. The response lists only rules you can see, after checking that you manage the folder. Rules are never changed automatically. While the job runs, the folder shows as converting and cannot be renamed, deleted or receive new messages. Rule saves targeting it are refused. One conversion runs per folder. Repeating the request for the same tag returns the running job. Each move is billed to the organization as messages.writes; tagging has no separate charge. A message with 20 other tags stays in the folder and stops the job. Failure or cancellation keeps the folder and releases its lock. A crash resumes safely. Readable organizations only (409 tags_coming_soon).
For the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
label (path) required | string | Label ID (lbl_…). |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Request body (JSON)
| Field | Type | Description |
tag required | string | The organization tag to use: live, in the inbox's organization. Pattern: ^tag_[0-9A-HJKMNP-TV-Z]{26}$. |
Response body (JSON)
| Field | Type | Description |
job required | string | The conversion job (job_). |
label required | string | The folder (lbl_). |
messages required | integer | Messages tagged and moved back to Inbox. |
status required | running | done | failed | |
tag required | string | The tag (tag_). |
reason | access | tag_deleted | zero_access | folder_deleted | rules | tag_limit | not_empty | folder_changed | Why the conversion stopped. |
Responses
| Status | Body | Meaning |
| 202 | FolderTagStatus | The change started (or was already under way). |
| 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 organization is read-only (read_only, design note 0024). |
| 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 | application/problem+json | Rules file into the folder (folder_rules, with only the rules you can see), another conversion holds the folder, permissions changed, or tags are unavailable for a zero-access organization (tags_coming_soon). |
| 422 | application/problem+json | Not a folder people made (Inbox and the built-in folders can't be turned into tags). |
| 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). |
Follow a folder turning into a tag
GET/inboxes/{inbox}/labels/{label}/tag/{job}
Whether the folder's change into a tag is running, done or failed, with counts of this inbox's messages. People who manage the inbox only (an access token or an assistant gets 403). The job is the one POST /inboxes/{inbox}/labels/{label}/tag answered with; it can be followed after the folder is gone.
For the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
label (path) required | string | Label ID (lbl_…). |
job (path) required | string | |
Response body (JSON)
| Field | Type | Description |
job required | string | The conversion job (job_). |
label required | string | The folder (lbl_). |
messages required | integer | Messages tagged and moved back to Inbox. |
status required | running | done | failed | |
tag required | string | The tag (tag_). |
reason | access | tag_deleted | zero_access | folder_deleted | rules | tag_limit | not_empty | folder_changed | Why the conversion stopped. |
Responses
| Status | Body | Meaning |
| 200 | FolderTagStatus | The change. |
| 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). |
| 409 | application/problem+json | Tags are coming soon for this organization (tags_coming_soon). |
| 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). |
List recoverable deleted messages
GET/inboxes/{inbox}/recoverable
Messages deleted for good from the inbox's Trash or Spam in the last 35 days (Empty Trash or Empty Spam, the 30-day auto-delete, a mail app's expunge in Trash), newest message first, one page at a time: pass nextCursor back as cursor. Messages deleted with Delete forever aren't here: that's final. Mail deleted before 2026-10-16, when recovery began, isn't either. People only: a person signed in to the web app, never an access token (403) or an assistant (403). Anyone with access to the inbox may. Works the same in zero-access inboxes (nothing is decrypted).
For the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
limit (query) | integer | Page size, 1 to 100. |
cursor (query) | string | The nextCursor of the previous page. |
Response body (JSON)
| Field | Type | Description |
days required | integer | How many days deleted messages stay recoverable (35). |
messages required | RecoverableMessage[] | |
nextCursor | string | |
Responses
| Status | Body | Meaning |
| 200 | JSON | One page of recoverable messages. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 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). |
Recover deleted messages
POST/inboxes/{inbox}/recoverable/recover
Puts chosen recoverable messages back, each in the folder it was in before Trash (or the Inbox; Spam for a message deleted from Spam), with its flags and a new UID (mail apps see it arrive). Each is a message.restored event and is billed as messages.restored; mail recovered out of Spam is billed as received mail, once. A message that can't be recovered in this inbox (past its 35 days, or recovered already) is gone; other messages in the request can still be recovered. A message that is already back is present. People only: a person signed in to the web app, never an access token (403) or an assistant (403). You need permission to edit the inbox. Works the same in zero-access inboxes (nothing is decrypted).
For the web app.
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 |
messages required | string[] | The messages (msg_), up to 100. |
{"messages":["msg_01J9Z3Q4W5E6R7T8Y9U0I1O2P3"]}
Response body (JSON)
| Field | Type | Description |
gone required | integer | No longer recoverable. |
present required | integer | Already back (put back another way). |
recovered required | integer | Put back. |
results required | object[] | |
Responses
| Status | Body | Meaning |
| 200 | JSON | What happened to each. |
| 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 organization is read-only (read_only, design note 0024): it has been 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 | application/problem+json | Inbox access changed, the inbox is being removed, or the same request is in progress. |
| 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). |
Find a sender's latest move
GET/inboxes/{inbox}/sender-moves
For people signed in to K8 HQ with messages:write and full access to this inbox. Tokens, assistants, outbox-only access and personal notice access are refused. Keep existing mail by default; start this job only after the person chooses Archive or Trash. The server takes the verified From address from messageId and uses before as the confirmation time (or the request time when omitted). It counts before moving: over 10,000 matches fails with reason too_many_messages and moves nothing. Only received mail from that checked address in this inbox, before confirmation, moves; starred mail and mail already in the target stay. Progress is durable across restarts. Each message moves with its saved source folders and new version. Undo is a second, idempotent job available for committed moves for 24 hours after the job succeeds, fails or is cancelled; changed, deleted or relabelled messages are skipped. Missing source folders are also skipped. undoJobId replaces undoUntil once Undo is started. The latest lookup accepts any verified message from that sender in this inbox and returns the last job that committed a move. Empty or failed attempts that moved nothing do not replace it, so the reader can find Undo after reopening. starredKept counts matching starred mail separately from skipped changes. Jobs and saved folders are kept for seven days after completion. A message in more than 19 folders stops the job before moving any mail (too_many_folders); move it by hand instead. One messages.writes per moved message (including Undo), plus normal api.requests. No mail is deleted for good.
For the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
messageId (query) required | string | |
Response body (JSON)
| Field | Type | Description |
before required | string | |
createdAt required | string | |
finishedAt required | string | |
id required | string | |
inboxId required | string | |
moved required | integer | |
skipped required | integer | |
starredKept required | integer | Matching messages kept because they were starred when counted, separate from messages skipped after a change. |
status required | queued | running | waiting | succeeded | failed | cancelled | |
target required | archive | trash | |
total required | integer | |
undoOf required | string | |
reason | too_many_messages | stopped | too_many_folders | |
undoJobId | string | |
undoUntil | string | Undo deadline for committed moves in a succeeded, failed or cancelled job. Absent when no messages moved or Undo has started. |
Responses
| Status | Body | Meaning |
| 200 | SenderMove | The saved move and its progress. |
| 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 | Credit is needed, the request key was reused, or Undo is no longer available. |
| 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 | application/problem+json | Credit is needed, the request key was reused, or Undo is no longer available. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Move a sender's existing mail
POST/inboxes/{inbox}/sender-moves
For people signed in to K8 HQ with messages:write and full access to this inbox. Tokens, assistants, outbox-only access and personal notice access are refused. Keep existing mail by default; start this job only after the person chooses Archive or Trash. The server takes the verified From address from messageId and uses before as the confirmation time (or the request time when omitted). It counts before moving: over 10,000 matches fails with reason too_many_messages and moves nothing. Only received mail from that checked address in this inbox, before confirmation, moves; starred mail and mail already in the target stay. Progress is durable across restarts. Each message moves with its saved source folders and new version. Undo is a second, idempotent job available for committed moves for 24 hours after the job succeeds, fails or is cancelled; changed, deleted or relabelled messages are skipped. Missing source folders are also skipped. undoJobId replaces undoUntil once Undo is started. The latest lookup accepts any verified message from that sender in this inbox and returns the last job that committed a move. Empty or failed attempts that moved nothing do not replace it, so the reader can find Undo after reopening. starredKept counts matching starred mail separately from skipped changes. Jobs and saved folders are kept for seven days after completion. A message in more than 19 folders stops the job before moving any mail (too_many_folders); move it by hand instead. One messages.writes per moved message (including Undo), plus normal api.requests. No mail is deleted for good.
For the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
Idempotency-Key (header) required | string | |
Request body (JSON)
| Field | Type | Description |
messageId required | string | |
target required | archive | trash | |
before | string | The time the person confirmed, in RFC 3339. Must not be in the future. Omit to use the request time. Keep this value when retrying. |
Response body (JSON)
| Field | Type | Description |
before required | string | |
createdAt required | string | |
finishedAt required | string | |
id required | string | |
inboxId required | string | |
moved required | integer | |
skipped required | integer | |
starredKept required | integer | Matching messages kept because they were starred when counted, separate from messages skipped after a change. |
status required | queued | running | waiting | succeeded | failed | cancelled | |
target required | archive | trash | |
total required | integer | |
undoOf required | string | |
reason | too_many_messages | stopped | too_many_folders | |
undoJobId | string | |
undoUntil | string | Undo deadline for committed moves in a succeeded, failed or cancelled job. Absent when no messages moved or Undo has started. |
Responses
| Status | Body | Meaning |
| 202 | SenderMove | The saved move and its progress. |
| 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 | Credit is needed, the request key was reused, or Undo is no longer available. |
| 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 | application/problem+json | Credit is needed, the request key was reused, or Undo is no longer available. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Check a sender move
GET/inboxes/{inbox}/sender-moves/{job}
For people signed in to K8 HQ with messages:write and full access to this inbox. Tokens, assistants, outbox-only access and personal notice access are refused. Keep existing mail by default; start this job only after the person chooses Archive or Trash. The server takes the verified From address from messageId and uses before as the confirmation time (or the request time when omitted). It counts before moving: over 10,000 matches fails with reason too_many_messages and moves nothing. Only received mail from that checked address in this inbox, before confirmation, moves; starred mail and mail already in the target stay. Progress is durable across restarts. Each message moves with its saved source folders and new version. Undo is a second, idempotent job available for committed moves for 24 hours after the job succeeds, fails or is cancelled; changed, deleted or relabelled messages are skipped. Missing source folders are also skipped. undoJobId replaces undoUntil once Undo is started. The latest lookup accepts any verified message from that sender in this inbox and returns the last job that committed a move. Empty or failed attempts that moved nothing do not replace it, so the reader can find Undo after reopening. starredKept counts matching starred mail separately from skipped changes. Jobs and saved folders are kept for seven days after completion. A message in more than 19 folders stops the job before moving any mail (too_many_folders); move it by hand instead. One messages.writes per moved message (including Undo), plus normal api.requests. No mail is deleted for good.
For the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
job (path) required | string | |
Response body (JSON)
| Field | Type | Description |
before required | string | |
createdAt required | string | |
finishedAt required | string | |
id required | string | |
inboxId required | string | |
moved required | integer | |
skipped required | integer | |
starredKept required | integer | Matching messages kept because they were starred when counted, separate from messages skipped after a change. |
status required | queued | running | waiting | succeeded | failed | cancelled | |
target required | archive | trash | |
total required | integer | |
undoOf required | string | |
reason | too_many_messages | stopped | too_many_folders | |
undoJobId | string | |
undoUntil | string | Undo deadline for committed moves in a succeeded, failed or cancelled job. Absent when no messages moved or Undo has started. |
Responses
| Status | Body | Meaning |
| 200 | SenderMove | The saved move and its progress. |
| 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 | Credit is needed, the request key was reused, or Undo is no longer available. |
| 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 | application/problem+json | Credit is needed, the request key was reused, or Undo is no longer available. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Undo a sender move
POST/inboxes/{inbox}/sender-moves/{job}/undo
For people signed in to K8 HQ with messages:write and full access to this inbox. Tokens, assistants, outbox-only access and personal notice access are refused. Keep existing mail by default; start this job only after the person chooses Archive or Trash. The server takes the verified From address from messageId and uses before as the confirmation time (or the request time when omitted). It counts before moving: over 10,000 matches fails with reason too_many_messages and moves nothing. Only received mail from that checked address in this inbox, before confirmation, moves; starred mail and mail already in the target stay. Progress is durable across restarts. Each message moves with its saved source folders and new version. Undo is a second, idempotent job available for committed moves for 24 hours after the job succeeds, fails or is cancelled; changed, deleted or relabelled messages are skipped. Missing source folders are also skipped. undoJobId replaces undoUntil once Undo is started. The latest lookup accepts any verified message from that sender in this inbox and returns the last job that committed a move. Empty or failed attempts that moved nothing do not replace it, so the reader can find Undo after reopening. starredKept counts matching starred mail separately from skipped changes. Jobs and saved folders are kept for seven days after completion. A message in more than 19 folders stops the job before moving any mail (too_many_folders); move it by hand instead. One messages.writes per moved message (including Undo), plus normal api.requests. No mail is deleted for good.
For the web app.
Parameters
| Name | Type | Description |
inbox (path) required | string | Inbox ID (ibx_…). |
job (path) required | string | |
Response body (JSON)
| Field | Type | Description |
before required | string | |
createdAt required | string | |
finishedAt required | string | |
id required | string | |
inboxId required | string | |
moved required | integer | |
skipped required | integer | |
starredKept required | integer | Matching messages kept because they were starred when counted, separate from messages skipped after a change. |
status required | queued | running | waiting | succeeded | failed | cancelled | |
target required | archive | trash | |
total required | integer | |
undoOf required | string | |
reason | too_many_messages | stopped | too_many_folders | |
undoJobId | string | |
undoUntil | string | Undo deadline for committed moves in a succeeded, failed or cancelled job. Absent when no messages moved or Undo has started. |
Responses
| Status | Body | Meaning |
| 202 | SenderMove | The saved move and its progress. |
| 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 | Credit is needed, the request key was reused, or Undo is no longer available. |
| 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 | application/problem+json | Credit is needed, the request key was reused, or Undo is no longer available. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |