# Mail

> Mailboxes, messages, threads, search, attachments and sending. Everything is addressed under an account.

URL: https://docs.workwae.com/reference/mail

Guides: [Read mail](/guides/mail), [Sending mail](/guides/sending), [Drafts](/guides/drafts), [Mail merge](/guides/mail-merge).

| Method | Path | Operation | Scope |
| --- | --- | --- | --- |
| `GET` | `/v1/accounts/{accountId}/mailboxes` | [List mailboxes (folders or labels)](#list-mailboxes-folders-or-labels) | `read` |
| `POST` | `/v1/accounts/{accountId}/mailboxes` | [Create a mailbox (folder or label)](#create-a-mailbox-folder-or-label) | `write` |
| `PATCH` | `/v1/accounts/{accountId}/mailboxes/{mailboxId}` | [Rename or move a mailbox](#rename-or-move-a-mailbox) | `write` |
| `DELETE` | `/v1/accounts/{accountId}/mailboxes/{mailboxId}` | [Delete a mailbox](#delete-a-mailbox) | `write` |
| `GET` | `/v1/accounts/{accountId}/messages` | [List messages, newest first](#list-messages-newest-first) | `read` |
| `GET` | `/v1/accounts/{accountId}/messages/{messageId}` | [Get a message with its body](#get-a-message-with-its-body) | `read` |
| `PATCH` | `/v1/accounts/{accountId}/messages/{messageId}` | [Change flags, move, or change labels](#change-flags-move-or-change-labels) | `write` |
| `DELETE` | `/v1/accounts/{accountId}/messages/{messageId}` | [Delete a message](#delete-a-message) | `write` |
| `GET` | `/v1/accounts/{accountId}/messages/{messageId}/raw` | [Download the message as RFC 5322 (message/rfc822)](#download-the-message-as-rfc-5322-messagerfc822) | `read` |
| `GET` | `/v1/accounts/{accountId}/messages/{messageId}/attachments/{attachmentId}` | [Download an attachment](#download-an-attachment) | `read` |
| `GET` | `/v1/accounts/{accountId}/search/messages` | [Search messages](#search-messages) | `read` |
| `GET` | `/v1/accounts/{accountId}/threads` | [List threads, latest activity first](#list-threads-latest-activity-first) | `read` |
| `GET` | `/v1/accounts/{accountId}/threads/{threadId}` | [Get a thread with its messages, oldest first](#get-a-thread-with-its-messages-oldest-first) | `read` |
| `PATCH` | `/v1/accounts/{accountId}/threads/{threadId}` | [Mark a thread read or unread, or move it](#mark-a-thread-read-or-unread-or-move-it) | `write` |
| `DELETE` | `/v1/accounts/{accountId}/threads/{threadId}` | [Move a thread to Trash](#move-a-thread-to-trash) | `write` |
| `POST` | `/v1/accounts/{accountId}/drafts` | [Create a draft](#create-a-draft) | `write` |
| `PUT` | `/v1/accounts/{accountId}/drafts/{messageId}` | [Replace a draft's content](#replace-a-drafts-content) | `write` |
| `DELETE` | `/v1/accounts/{accountId}/drafts/{messageId}` | [Delete a draft](#delete-a-draft) | `write` |
| `POST` | `/v1/accounts/{accountId}/drafts/{messageId}/send` | [Send a draft](#send-a-draft) | `send` |
| `GET` | `/v1/accounts/{accountId}/outbox` | [List queued and recent sends, newest first](#list-queued-and-recent-sends-newest-first) | `read` |
| `POST` | `/v1/accounts/{accountId}/outbox` | [Send a message](#send-a-message) | `send` |
| `GET` | `/v1/accounts/{accountId}/outbox/{outboxId}` | [Get a send](#get-a-send) | `read` |
| `PATCH` | `/v1/accounts/{accountId}/outbox/{outboxId}` | [Reschedule a queued send](#reschedule-a-queued-send) | `send` |
| `DELETE` | `/v1/accounts/{accountId}/outbox/{outboxId}` | [Cancel a queued send](#cancel-a-queued-send) | `send` |
| `GET` | `/v1/accounts/{accountId}/outbox/{outboxId}/tracking` | [List a send's opens and clicks](#list-a-sends-opens-and-clicks) | `read` |
| `GET` | `/v1/accounts/{accountId}/mail-merges` | [List mail merges, newest first](#list-mail-merges-newest-first) | `read` |
| `POST` | `/v1/accounts/{accountId}/mail-merges` | [Send one message per recipient (mail merge)](#send-one-message-per-recipient-mail-merge) | `send` |
| `GET` | `/v1/accounts/{accountId}/mail-merges/{mailMergeId}` | [Get a mail merge](#get-a-mail-merge) | `read` |
| `POST` | `/v1/accounts/{accountId}/mail-merges/{mailMergeId}/cancel` | [Cancel a mail merge's queued entries](#cancel-a-mail-merges-queued-entries) | `send` |

## List mailboxes (folders or labels)

`GET /v1/accounts/{accountId}/mailboxes`

TypeScript SDK method: `workwae.mailboxes.list()`

Required scope: `read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | object[] | yes |  |
| `items[].id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `items[].name` | string | yes |  |
| `items[].path` | string | yes |  |
| `items[].parentId` | string (uuid) \| null | yes | Example `"1adf657e-5e25-4548-989a-ccbcf88b0d04"`. |
| `items[].role` | "inbox" \| "sent" \| "drafts" \| "trash" \| "junk" \| "archive" \| "all" \| "important" \| "custom" | yes |  |
| `items[].kind` | "folder" \| "label" | yes |  |
| `items[].totalCount` | integer \| null | yes |  |
| `items[].unreadCount` | integer \| null | yes |  |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`
  - 404: `account_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Create a mailbox (folder or label)

`POST /v1/accounts/{accountId}/mailboxes`

TypeScript SDK method: `workwae.mailboxes.create()`

Microsoft and IMAP create a folder; Gmail creates a label (nested with '/' in the label name when parentId is set). A folder that is not empty can be deleted later: Microsoft deletes the folder and the messages in it, Gmail removes the label and leaves the messages, IMAP deletes the mailbox and its messages and refuses a mailbox that still has child mailboxes (provider_rejected).

Required scope: `write`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |

### Request body (required)

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | yes | 1 to 255 characters. |
| `parentId` | string (uuid) | no | Example `"1adf657e-5e25-4548-989a-ccbcf88b0d04"`. |

### Responses

- **201** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `name` | string | yes |  |
| `path` | string | yes |  |
| `parentId` | string (uuid) \| null | yes | Example `"1adf657e-5e25-4548-989a-ccbcf88b0d04"`. |
| `role` | "inbox" \| "sent" \| "drafts" \| "trash" \| "junk" \| "archive" \| "all" \| "important" \| "custom" | yes |  |
| `kind` | "folder" \| "label" | yes |  |
| `totalCount` | integer \| null | yes |  |
| `unreadCount` | integer \| null | yes |  |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `group_unsupported`, `provider_rejected`, `provider_unsupported`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `provider_forbidden`
  - 404: `account_not_found`, `provider_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `mail_permission_missing`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`, `provider_conflict`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `unknown_mailbox`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Rename or move a mailbox

`PATCH /v1/accounts/{accountId}/mailboxes/{mailboxId}`

TypeScript SDK method: `workwae.mailboxes.update()`

Refused for system and special-use mailboxes (Inbox, Sent, Drafts, Trash, Junk, Archive, Gmail system labels) with mailbox_protected. parentId null moves it to the top level. On Gmail the label's name keeps '/' between a parent label and this one.

Required scope: `write`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `mailboxId` | path | string (uuid) | yes | Example `"8a3f5c7e-2d4b-4c6e-9f1a-3b5d7f9e1c2a"`. |

### Request body

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | 1 to 255 characters. |
| `parentId` | string (uuid) \| null | no | Example `"1adf657e-5e25-4548-989a-ccbcf88b0d04"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `name` | string | yes |  |
| `path` | string | yes |  |
| `parentId` | string (uuid) \| null | yes | Example `"1adf657e-5e25-4548-989a-ccbcf88b0d04"`. |
| `role` | "inbox" \| "sent" \| "drafts" \| "trash" \| "junk" \| "archive" \| "all" \| "important" \| "custom" | yes |  |
| `kind` | "folder" \| "label" | yes |  |
| `totalCount` | integer \| null | yes |  |
| `unreadCount` | integer \| null | yes |  |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `mailbox_parent`, `group_unsupported`, `provider_rejected`, `provider_unsupported`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `provider_forbidden`
  - 404: `account_not_found`, `provider_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `mail_permission_missing`, `mailbox_protected`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`, `provider_conflict`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `unknown_mailbox`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Delete a mailbox

`DELETE /v1/accounts/{accountId}/mailboxes/{mailboxId}`

TypeScript SDK method: `workwae.mailboxes.delete()`

Refused for system and special-use mailboxes (mailbox_protected). Microsoft deletes the folder and the messages in it (child folders are refused, provider_rejected). Gmail deletes the label and takes it off its messages, which stay. IMAP deletes the mailbox and its messages; a mailbox that still has children is refused by the server (provider_rejected). The index drops the mailbox now; messages it held leave on the next sync, the same way a deletion made elsewhere does.

Required scope: `write`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `mailboxId` | path | string (uuid) | yes | Example `"8a3f5c7e-2d4b-4c6e-9f1a-3b5d7f9e1c2a"`. |

### Responses

- **204** OK (application/json, any)
- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `group_unsupported`, `provider_rejected`, `provider_unsupported`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `provider_forbidden`
  - 404: `account_not_found`, `provider_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `mail_permission_missing`, `mailbox_protected`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`, `provider_conflict`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `unknown_mailbox`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## List messages, newest first

`GET /v1/accounts/{accountId}/messages`

TypeScript SDK method: `workwae.messages.list()`

Covers the account's sync window. Without mailboxId, lists every mailbox. importance keeps the messages with that priority; messages indexed before priorities were read (importance null) match none. from and to match part of an address or display name, case-insensitive (to looks at To, Cc and Bcc); after and before bound receivedAt. outboxId and internetMessageId match exactly (internetMessageId as one <id>, angle brackets included) and combine with every other filter. include=body answers MessagePage, with each item the full Message that messages.get returns (add headers for its header fields: include=body,headers), instead of MessageSummaryPage; the page holds 25 messages at most (default 25), a larger limit is refused. Bodies come from stored content when the account stores bodies and from the provider otherwise, a few messages at a time; a message the provider cannot serve fails the whole page with the error messages.get would answer for it.

Required scope: `read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `mailboxId` | query | string (uuid) | no | Example `"8a3f5c7e-2d4b-4c6e-9f1a-3b5d7f9e1c2a"`. |
| `from` | query | string | no | 1 to 320 characters. |
| `to` | query | string | no | 1 to 320 characters. |
| `unread` | query | boolean \| "true" \| "false" | no |  |
| `flagged` | query | boolean \| "true" \| "false" | no |  |
| `hasAttachments` | query | boolean \| "true" \| "false" | no |  |
| `importance` | query | "high" \| "normal" \| "low" | no |  |
| `outboxId` | query | string (uuid) | no | Example `"6305f547-a117-46c0-811c-4395f19f91db"`. |
| `internetMessageId` | query | string | no | At most 998 characters. Example `"<CAF3x9a@mail.example.org>"`. |
| `after` | query | string (date-time) | no | Example `"2026-05-04T09:30:00.000Z"`. |
| `before` | query | string (date-time) | no | Example `"2026-05-04T09:30:00.000Z"`. |
| `include` | query | string \| ("body" \| "headers")[] | no |  |
| `limit` | query | integer | no | 1 to 200. |
| `cursor` | query | string | no | 1 to 512 characters. Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |

### Responses

- **200** OK (application/json, object)
- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `invalid_cursor`, `invalid_range`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `provider_forbidden`
  - 404: `account_not_found`, `provider_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `unknown_mailbox`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Get a message with its body

`GET /v1/accounts/{accountId}/messages/{messageId}`

TypeScript SDK method: `workwae.messages.get()`

With bodyStorage cache or full the body comes from stored content (cache fetches and stores the raw message on a miss), and attachment ids are MIME part numbers ("1.2"); otherwise it is read from the provider. Drafts are always read from the provider. inReplyTo and references come from the message's In-Reply-To and References headers; include=headers adds every top-level header field (headers), which is left out otherwise.

Required scope: `read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `messageId` | path | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `include` | query | string \| "headers"[] | no |  |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `threadId` | string \| null | yes | Example `"18f2a3b4c5d6e7f8"`. |
| `internetMessageId` | string \| null | yes | Example `"<CAF3x9a@mail.example.org>"`. |
| `mailboxIds` | string (uuid)[] | yes |  |
| `subject` | string \| null | yes | Example `"Quarterly report"`. |
| `from` | object \| null | yes |  |
| `from.name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `from.address` | string | yes | Example `"ada@example.com"`. |
| `to` | object[] | yes |  |
| `to[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `to[].address` | string | yes | Example `"ada@example.com"`. |
| `cc` | object[] | yes |  |
| `cc[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `cc[].address` | string | yes | Example `"ada@example.com"`. |
| `snippet` | string \| null | yes | Example `"Hi Ada, the numbers for the quarter are attached."`. |
| `receivedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `sentAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `isRead` | boolean | yes |  |
| `isFlagged` | boolean | yes |  |
| `isDraft` | boolean | yes |  |
| `hasAttachments` | boolean | yes |  |
| `categories` | string[] | yes |  |
| `direction` | "inbound" \| "outbound" | yes |  |
| `outboxId` | string (uuid) \| null | yes | Example `"6305f547-a117-46c0-811c-4395f19f91db"`. |
| `reference` | string \| null | yes |  |
| `importance` | "high" \| "normal" \| "low" \| null | yes |  |
| `inReplyTo` | string \| null | yes |  |
| `references` | string[] | yes |  |
| `bcc` | object[] | yes |  |
| `bcc[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `bcc[].address` | string | yes | Example `"ada@example.com"`. |
| `replyTo` | object[] | yes |  |
| `replyTo[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `replyTo[].address` | string | yes | Example `"ada@example.com"`. |
| `body` | object | yes |  |
| `body.text` | string \| null | yes |  |
| `body.html` | string \| null | yes |  |
| `attachments` | object[] | yes |  |
| `attachments[].id` | string | yes | 1 to 1024 characters. |
| `attachments[].filename` | string \| null | yes |  |
| `attachments[].contentType` | string | yes |  |
| `attachments[].size` | integer \| null | yes |  |
| `attachments[].isInline` | boolean | yes |  |
| `attachments[].contentId` | string \| null | yes |  |
| `classification` | object \| null | yes |  |
| `classification.kind` | "opt_out" \| "auto_reply" \| "bounce" \| "human_reply" | yes |  |
| `classification.probabilities` | object | yes |  |
| `classification.optOutProbability` | number | yes |  |
| `classification.autoReplyCategory` | "out_of_office" \| "left_company" \| "address_changed" \| "ticket_acknowledgment" \| "challenge_response" \| "other" \| null | yes |  |
| `classification.returnDate` | string (date) \| null | yes | Example `"2026-05-04"`. |
| `classification.alternateContacts` | string[] | yes |  |
| `classification.outboxId` | string (uuid) \| null | yes | Example `"6305f547-a117-46c0-811c-4395f19f91db"`. |
| `classification.model` | string | yes |  |
| `classification.classifiedAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `headers` | object[] | no |  |
| `headers[].name` | string | yes |  |
| `headers[].value` | string | yes |  |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `provider_forbidden`
  - 404: `account_not_found`, `message_not_found`, `provider_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Change flags, move, or change labels

`PATCH /v1/accounts/{accountId}/messages/{messageId}`

TypeScript SDK method: `workwae.messages.update()`

mailboxId moves the message (Microsoft folders, or Gmail: replaces the message's folder-like labels). addMailboxIds/removeMailboxIds apply Gmail labels.

Required scope: `write`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `messageId` | path | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |

### Request body

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `isRead` | boolean | no |  |
| `isFlagged` | boolean | no |  |
| `mailboxId` | string (uuid) | no | Example `"8a3f5c7e-2d4b-4c6e-9f1a-3b5d7f9e1c2a"`. |
| `addMailboxIds` | string (uuid)[] | no | At most 50 items. |
| `removeMailboxIds` | string (uuid)[] | no | At most 50 items. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `threadId` | string \| null | yes | Example `"18f2a3b4c5d6e7f8"`. |
| `internetMessageId` | string \| null | yes | Example `"<CAF3x9a@mail.example.org>"`. |
| `mailboxIds` | string (uuid)[] | yes |  |
| `subject` | string \| null | yes | Example `"Quarterly report"`. |
| `from` | object \| null | yes |  |
| `from.name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `from.address` | string | yes | Example `"ada@example.com"`. |
| `to` | object[] | yes |  |
| `to[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `to[].address` | string | yes | Example `"ada@example.com"`. |
| `cc` | object[] | yes |  |
| `cc[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `cc[].address` | string | yes | Example `"ada@example.com"`. |
| `snippet` | string \| null | yes | Example `"Hi Ada, the numbers for the quarter are attached."`. |
| `receivedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `sentAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `isRead` | boolean | yes |  |
| `isFlagged` | boolean | yes |  |
| `isDraft` | boolean | yes |  |
| `hasAttachments` | boolean | yes |  |
| `categories` | string[] | yes |  |
| `direction` | "inbound" \| "outbound" | yes |  |
| `outboxId` | string (uuid) \| null | yes | Example `"6305f547-a117-46c0-811c-4395f19f91db"`. |
| `reference` | string \| null | yes |  |
| `importance` | "high" \| "normal" \| "low" \| null | yes |  |
| `inReplyTo` | string \| null | yes |  |
| `references` | string[] | yes |  |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `mailbox_not_label`, `provider_rejected`, `provider_unsupported`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `provider_forbidden`
  - 404: `account_not_found`, `message_not_found`, `provider_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `mail_permission_missing`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`, `provider_conflict`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `unknown_mailbox`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Delete a message

`DELETE /v1/accounts/{accountId}/messages/{messageId}`

TypeScript SDK method: `workwae.messages.delete()`

Moves it to Trash; ?permanent=true deletes it outright.

Required scope: `write`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `messageId` | path | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `permanent` | query | boolean \| "true" \| "false" | no | Default `false`. |

### Responses

- **204** OK (application/json, any)
- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `provider_rejected`, `provider_unsupported`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `provider_forbidden`
  - 404: `account_not_found`, `message_not_found`, `provider_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `mail_permission_missing`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`, `provider_conflict`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Download the message as RFC 5322 (message/rfc822)

`GET /v1/accounts/{accountId}/messages/{messageId}/raw`

TypeScript SDK method: `workwae.messages.raw()`

Served from stored content when the account stores bodies.

Required scope: `read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `messageId` | path | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |

### Responses

- **200** The message as message/rfc822 (message/rfc822, string)
- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `provider_forbidden`
  - 404: `account_not_found`, `message_not_found`, `provider_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Download an attachment

`GET /v1/accounts/{accountId}/messages/{messageId}/attachments/{attachmentId}`

TypeScript SDK method: `workwae.messages.attachment()`

Served from stored content when the account stores bodies; an id the stored message does not have is asked of the provider, which answers provider_not_found when it has no such attachment either.

Required scope: `read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `messageId` | path | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `attachmentId` | path | string | yes | 1 to 1024 characters. |

### Responses

- **200** The attachment, with the Content-Type it was sent with (*/*, string)
- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `provider_forbidden`
  - 404: `account_not_found`, `message_not_found`, `provider_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Search messages

`GET /v1/accounts/{accountId}/search/messages`

TypeScript SDK method: `workwae.search.messages()`

source=index searches the index with full-text search (q in web search syntax: words, "phrases", OR, -word) over subject, sender and recipient names and addresses, the snippet, and the body text of stored messages (bodyStorage cache or full), best matches first. source=provider passes q to the provider unchanged (Gmail search syntax, Microsoft KQL, IMAP SEARCH TEXT), newest first; results the index holds carry their id, others id null. source=auto (default) asks the provider when the index cannot cover the request: `after` lies before the sync window, or the index found nothing while it does not hold everything (the account has a sync window, or bodyStorage is not full). Otherwise, and whenever the provider cannot be asked (inactive account, rate limit, provider error), the index answers. from, to, unread, flagged and hasAttachments narrow either source's results as on messages.list; a provider page they narrow can hold fewer than limit results while nextCursor goes on. The response names the source that answered; nextCursor stays with it. A provider search of a Gmail account counts against the account's Gmail searches per minute; past them it answers rate_limited with Retry-After.

Required scope: `read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `q` | query | string | yes | 1 to 500 characters. Example `"invoice"`. |
| `mailboxId` | query | string (uuid) | no | Example `"8a3f5c7e-2d4b-4c6e-9f1a-3b5d7f9e1c2a"`. |
| `from` | query | string | no | 1 to 320 characters. |
| `to` | query | string | no | 1 to 320 characters. |
| `unread` | query | boolean \| "true" \| "false" | no |  |
| `flagged` | query | boolean \| "true" \| "false" | no |  |
| `hasAttachments` | query | boolean \| "true" \| "false" | no |  |
| `after` | query | string (date-time) | no | Example `"2026-05-04T09:30:00.000Z"`. |
| `before` | query | string (date-time) | no | Example `"2026-05-04T09:30:00.000Z"`. |
| `source` | query | "auto" \| "index" \| "provider" | no | Default `"auto"`. |
| `limit` | query | integer | no | 1 to 100. Default `25`. |
| `cursor` | query | string | no | 1 to 512 characters. Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | object[] | yes |  |
| `items[].id` | string (uuid) \| null | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `items[].threadId` | string \| null | yes | Example `"18f2a3b4c5d6e7f8"`. |
| `items[].internetMessageId` | string \| null | yes | Example `"<CAF3x9a@mail.example.org>"`. |
| `items[].mailboxIds` | string (uuid)[] | yes |  |
| `items[].subject` | string \| null | yes | Example `"Quarterly report"`. |
| `items[].from` | object \| null | yes |  |
| `items[].from.name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `items[].from.address` | string | yes | Example `"ada@example.com"`. |
| `items[].to` | object[] | yes |  |
| `items[].to[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `items[].to[].address` | string | yes | Example `"ada@example.com"`. |
| `items[].cc` | object[] | yes |  |
| `items[].cc[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `items[].cc[].address` | string | yes | Example `"ada@example.com"`. |
| `items[].snippet` | string \| null | yes | Example `"Hi Ada, the numbers for the quarter are attached."`. |
| `items[].receivedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].sentAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].isRead` | boolean | yes |  |
| `items[].isFlagged` | boolean | yes |  |
| `items[].isDraft` | boolean | yes |  |
| `items[].hasAttachments` | boolean | yes |  |
| `items[].categories` | string[] | yes |  |
| `items[].direction` | "inbound" \| "outbound" | yes |  |
| `items[].outboxId` | string (uuid) \| null | yes | Example `"6305f547-a117-46c0-811c-4395f19f91db"`. |
| `items[].reference` | string \| null | yes |  |
| `items[].importance` | "high" \| "normal" \| "low" \| null | yes |  |
| `items[].inReplyTo` | string \| null | yes |  |
| `items[].references` | string[] | yes |  |
| `nextCursor` | string \| null | yes | Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |
| `source` | "index" \| "provider" | yes |  |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `invalid_range`, `invalid_cursor`, `provider_rejected`, `provider_unsupported`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `provider_forbidden`
  - 404: `account_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `unknown_mailbox`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## List threads, latest activity first

`GET /v1/accounts/{accountId}/threads`

TypeScript SDK method: `workwae.threads.list()`

Covers the account's sync window. With mailboxId, lists threads with a message in that mailbox, ordered by their latest message there; each summary still describes the whole thread.

Required scope: `read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `mailboxId` | query | string (uuid) | no | Example `"8a3f5c7e-2d4b-4c6e-9f1a-3b5d7f9e1c2a"`. |
| `limit` | query | integer | no | 1 to 100. Default `25`. |
| `cursor` | query | string | no | 1 to 512 characters. Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | object[] | yes |  |
| `items[].id` | string | yes | 1 to 1024 characters. |
| `items[].subject` | string \| null | yes | Example `"Quarterly report"`. |
| `items[].snippet` | string \| null | yes | Example `"Hi Ada, the numbers for the quarter are attached."`. |
| `items[].participants` | object[] | yes |  |
| `items[].participants[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `items[].participants[].address` | string | yes | Example `"ada@example.com"`. |
| `items[].messageCount` | integer | yes |  |
| `items[].unreadCount` | integer | yes |  |
| `items[].isFlagged` | boolean | yes |  |
| `items[].hasAttachments` | boolean | yes |  |
| `items[].hasDrafts` | boolean | yes |  |
| `items[].mailboxIds` | string (uuid)[] | yes |  |
| `items[].latestMessageId` | string (uuid) | yes | Example `"3e8ac85f-c412-433a-a738-8be7894e4050"`. |
| `items[].lastMessageAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `nextCursor` | string \| null | yes | Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `invalid_cursor`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`
  - 404: `account_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `unknown_mailbox`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Get a thread with its messages, oldest first

`GET /v1/accounts/{accountId}/threads/{threadId}`

TypeScript SDK method: `workwae.threads.get()`

Required scope: `read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `threadId` | path | string | yes | 1 to 1024 characters. Example `"18f2a3b4c5d6e7f8"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | 1 to 1024 characters. |
| `subject` | string \| null | yes | Example `"Quarterly report"`. |
| `snippet` | string \| null | yes | Example `"Hi Ada, the numbers for the quarter are attached."`. |
| `participants` | object[] | yes |  |
| `participants[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `participants[].address` | string | yes | Example `"ada@example.com"`. |
| `messageCount` | integer | yes |  |
| `unreadCount` | integer | yes |  |
| `isFlagged` | boolean | yes |  |
| `hasAttachments` | boolean | yes |  |
| `hasDrafts` | boolean | yes |  |
| `mailboxIds` | string (uuid)[] | yes |  |
| `latestMessageId` | string (uuid) | yes | Example `"3e8ac85f-c412-433a-a738-8be7894e4050"`. |
| `lastMessageAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `messages` | object[] | yes |  |
| `messages[].id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `messages[].threadId` | string \| null | yes | Example `"18f2a3b4c5d6e7f8"`. |
| `messages[].internetMessageId` | string \| null | yes | Example `"<CAF3x9a@mail.example.org>"`. |
| `messages[].mailboxIds` | string (uuid)[] | yes |  |
| `messages[].subject` | string \| null | yes | Example `"Quarterly report"`. |
| `messages[].from` | object \| null | yes |  |
| `messages[].from.name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `messages[].from.address` | string | yes | Example `"ada@example.com"`. |
| `messages[].to` | object[] | yes |  |
| `messages[].to[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `messages[].to[].address` | string | yes | Example `"ada@example.com"`. |
| `messages[].cc` | object[] | yes |  |
| `messages[].cc[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `messages[].cc[].address` | string | yes | Example `"ada@example.com"`. |
| `messages[].snippet` | string \| null | yes | Example `"Hi Ada, the numbers for the quarter are attached."`. |
| `messages[].receivedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `messages[].sentAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `messages[].isRead` | boolean | yes |  |
| `messages[].isFlagged` | boolean | yes |  |
| `messages[].isDraft` | boolean | yes |  |
| `messages[].hasAttachments` | boolean | yes |  |
| `messages[].categories` | string[] | yes |  |
| `messages[].direction` | "inbound" \| "outbound" | yes |  |
| `messages[].outboxId` | string (uuid) \| null | yes | Example `"6305f547-a117-46c0-811c-4395f19f91db"`. |
| `messages[].reference` | string \| null | yes |  |
| `messages[].importance` | "high" \| "normal" \| "low" \| null | yes |  |
| `messages[].inReplyTo` | string \| null | yes |  |
| `messages[].references` | string[] | yes |  |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`
  - 404: `account_not_found`, `thread_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Mark a thread read or unread, or move it

`PATCH /v1/accounts/{accountId}/threads/{threadId}`

TypeScript SDK method: `workwae.threads.update()`

Applies the change to every message of the thread through the message operations; messages already in that state are skipped. mailboxId moves each message there (Gmail: replaces its folder-like labels). A failure part way leaves the messages done so far changed; repeating the call finishes the rest.

Required scope: `write`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `threadId` | path | string | yes | 1 to 1024 characters. Example `"18f2a3b4c5d6e7f8"`. |

### Request body

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `isRead` | boolean | no |  |
| `mailboxId` | string (uuid) | no | Example `"8a3f5c7e-2d4b-4c6e-9f1a-3b5d7f9e1c2a"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | 1 to 1024 characters. |
| `subject` | string \| null | yes | Example `"Quarterly report"`. |
| `snippet` | string \| null | yes | Example `"Hi Ada, the numbers for the quarter are attached."`. |
| `participants` | object[] | yes |  |
| `participants[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `participants[].address` | string | yes | Example `"ada@example.com"`. |
| `messageCount` | integer | yes |  |
| `unreadCount` | integer | yes |  |
| `isFlagged` | boolean | yes |  |
| `hasAttachments` | boolean | yes |  |
| `hasDrafts` | boolean | yes |  |
| `mailboxIds` | string (uuid)[] | yes |  |
| `latestMessageId` | string (uuid) | yes | Example `"3e8ac85f-c412-433a-a738-8be7894e4050"`. |
| `lastMessageAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `messages` | object[] | yes |  |
| `messages[].id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `messages[].threadId` | string \| null | yes | Example `"18f2a3b4c5d6e7f8"`. |
| `messages[].internetMessageId` | string \| null | yes | Example `"<CAF3x9a@mail.example.org>"`. |
| `messages[].mailboxIds` | string (uuid)[] | yes |  |
| `messages[].subject` | string \| null | yes | Example `"Quarterly report"`. |
| `messages[].from` | object \| null | yes |  |
| `messages[].from.name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `messages[].from.address` | string | yes | Example `"ada@example.com"`. |
| `messages[].to` | object[] | yes |  |
| `messages[].to[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `messages[].to[].address` | string | yes | Example `"ada@example.com"`. |
| `messages[].cc` | object[] | yes |  |
| `messages[].cc[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `messages[].cc[].address` | string | yes | Example `"ada@example.com"`. |
| `messages[].snippet` | string \| null | yes | Example `"Hi Ada, the numbers for the quarter are attached."`. |
| `messages[].receivedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `messages[].sentAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `messages[].isRead` | boolean | yes |  |
| `messages[].isFlagged` | boolean | yes |  |
| `messages[].isDraft` | boolean | yes |  |
| `messages[].hasAttachments` | boolean | yes |  |
| `messages[].categories` | string[] | yes |  |
| `messages[].direction` | "inbound" \| "outbound" | yes |  |
| `messages[].outboxId` | string (uuid) \| null | yes | Example `"6305f547-a117-46c0-811c-4395f19f91db"`. |
| `messages[].reference` | string \| null | yes |  |
| `messages[].importance` | "high" \| "normal" \| "low" \| null | yes |  |
| `messages[].inReplyTo` | string \| null | yes |  |
| `messages[].references` | string[] | yes |  |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `provider_rejected`, `provider_unsupported`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `provider_forbidden`
  - 404: `account_not_found`, `thread_not_found`, `provider_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `mail_permission_missing`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`, `provider_conflict`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `unknown_mailbox`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Move a thread to Trash

`DELETE /v1/accounts/{accountId}/threads/{threadId}`

TypeScript SDK method: `workwae.threads.delete()`

Moves every message of the thread that is not already there to Trash. A failure part way leaves the messages done so far changed; repeating the call finishes the rest.

Required scope: `write`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `threadId` | path | string | yes | 1 to 1024 characters. Example `"18f2a3b4c5d6e7f8"`. |

### Responses

- **204** OK (application/json, any)
- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `provider_rejected`, `provider_unsupported`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `provider_forbidden`
  - 404: `account_not_found`, `thread_not_found`, `provider_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `mail_permission_missing`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`, `provider_conflict`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Create a draft

`POST /v1/accounts/{accountId}/drafts`

TypeScript SDK method: `workwae.drafts.create()`

Content is rendered when the request is taken, so later template edits never change it.

Required scope: `write`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |

### Request body

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `to` | object[] | no | At most 500 items. Default `[]`. |
| `to[].name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `to[].address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `cc` | object[] | no | At most 500 items. Default `[]`. |
| `cc[].name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `cc[].address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `bcc` | object[] | no | At most 500 items. Default `[]`. |
| `bcc[].name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `bcc[].address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `replyTo` | object[] | no | At most 10 items. Default `[]`. |
| `replyTo[].name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `replyTo[].address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `subject` | string | no | At most 998 characters. Example `"Quarterly report"`. |
| `text` | string | no | At most 2097152 characters. |
| `html` | string | no | At most 2097152 characters. |
| `attachments` | object[] | no | At most 50 items. Default `[]`. |
| `attachments[].filename` | string | yes | 1 to 255 characters. |
| `attachments[].contentType` | string | yes | 1 to 255 characters. |
| `attachments[].content` | string | yes |  |
| `attachments[].contentId` | string | no | At most 255 characters. |
| `inReplyToMessageId` | string (uuid) | no | Example `"7edc492b-4897-497f-9af1-f099d7395c7f"`. |
| `from` | object | no |  |
| `from.name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `from.address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `signature` | boolean | no |  |
| `priority` | "high" \| "normal" \| "low" | no | Default `"normal"`. |
| `template` | string (uuid) | no | Example `"3226ecbe-6502-43a4-9cd0-3ae67140750e"`. |
| `render` | object | no |  |
| `render.params` | object | no | Default `{}`. |
| `previewText` | string | no | At most 2000 characters. |
| `format` | "html" \| "markdown" | no |  |

### Responses

- **201** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `threadId` | string \| null | yes | Example `"18f2a3b4c5d6e7f8"`. |
| `internetMessageId` | string \| null | yes | Example `"<CAF3x9a@mail.example.org>"`. |
| `mailboxIds` | string (uuid)[] | yes |  |
| `subject` | string \| null | yes | Example `"Quarterly report"`. |
| `from` | object \| null | yes |  |
| `from.name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `from.address` | string | yes | Example `"ada@example.com"`. |
| `to` | object[] | yes |  |
| `to[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `to[].address` | string | yes | Example `"ada@example.com"`. |
| `cc` | object[] | yes |  |
| `cc[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `cc[].address` | string | yes | Example `"ada@example.com"`. |
| `snippet` | string \| null | yes | Example `"Hi Ada, the numbers for the quarter are attached."`. |
| `receivedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `sentAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `isRead` | boolean | yes |  |
| `isFlagged` | boolean | yes |  |
| `isDraft` | boolean | yes |  |
| `hasAttachments` | boolean | yes |  |
| `categories` | string[] | yes |  |
| `direction` | "inbound" \| "outbound" | yes |  |
| `outboxId` | string (uuid) \| null | yes | Example `"6305f547-a117-46c0-811c-4395f19f91db"`. |
| `reference` | string \| null | yes |  |
| `importance` | "high" \| "normal" \| "low" \| null | yes |  |
| `inReplyTo` | string \| null | yes |  |
| `references` | string[] | yes |  |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `from_not_allowed`, `attachments_too_large`, `template_account_mismatch`, `template_and_inline_fields`, `invalid_template`, `params_too_large`, `template_render_failed`, `provider_rejected`, `provider_unsupported`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `provider_forbidden`
  - 404: `account_not_found`, `provider_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`, `provider_conflict`, `mail_permission_missing`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `unknown_reply_target`, `unknown_template`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`, `draft_lost`
  - 503: `overloaded`

## Replace a draft's content

`PUT /v1/accounts/{accountId}/drafts/{messageId}`

TypeScript SDK method: `workwae.drafts.update()`

Content is rendered when the request is taken, so later template edits never change it.

Required scope: `write`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `messageId` | path | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |

### Request body

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `to` | object[] | no | At most 500 items. Default `[]`. |
| `to[].name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `to[].address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `cc` | object[] | no | At most 500 items. Default `[]`. |
| `cc[].name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `cc[].address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `bcc` | object[] | no | At most 500 items. Default `[]`. |
| `bcc[].name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `bcc[].address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `replyTo` | object[] | no | At most 10 items. Default `[]`. |
| `replyTo[].name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `replyTo[].address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `subject` | string | no | At most 998 characters. Example `"Quarterly report"`. |
| `text` | string | no | At most 2097152 characters. |
| `html` | string | no | At most 2097152 characters. |
| `attachments` | object[] | no | At most 50 items. Default `[]`. |
| `attachments[].filename` | string | yes | 1 to 255 characters. |
| `attachments[].contentType` | string | yes | 1 to 255 characters. |
| `attachments[].content` | string | yes |  |
| `attachments[].contentId` | string | no | At most 255 characters. |
| `inReplyToMessageId` | string (uuid) | no | Example `"7edc492b-4897-497f-9af1-f099d7395c7f"`. |
| `from` | object | no |  |
| `from.name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `from.address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `signature` | boolean | no |  |
| `priority` | "high" \| "normal" \| "low" | no | Default `"normal"`. |
| `template` | string (uuid) | no | Example `"3226ecbe-6502-43a4-9cd0-3ae67140750e"`. |
| `render` | object | no |  |
| `render.params` | object | no | Default `{}`. |
| `previewText` | string | no | At most 2000 characters. |
| `format` | "html" \| "markdown" | no |  |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `threadId` | string \| null | yes | Example `"18f2a3b4c5d6e7f8"`. |
| `internetMessageId` | string \| null | yes | Example `"<CAF3x9a@mail.example.org>"`. |
| `mailboxIds` | string (uuid)[] | yes |  |
| `subject` | string \| null | yes | Example `"Quarterly report"`. |
| `from` | object \| null | yes |  |
| `from.name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `from.address` | string | yes | Example `"ada@example.com"`. |
| `to` | object[] | yes |  |
| `to[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `to[].address` | string | yes | Example `"ada@example.com"`. |
| `cc` | object[] | yes |  |
| `cc[].name` | string \| null | yes | Example `"Ada Lovelace"`. |
| `cc[].address` | string | yes | Example `"ada@example.com"`. |
| `snippet` | string \| null | yes | Example `"Hi Ada, the numbers for the quarter are attached."`. |
| `receivedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `sentAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `isRead` | boolean | yes |  |
| `isFlagged` | boolean | yes |  |
| `isDraft` | boolean | yes |  |
| `hasAttachments` | boolean | yes |  |
| `categories` | string[] | yes |  |
| `direction` | "inbound" \| "outbound" | yes |  |
| `outboxId` | string (uuid) \| null | yes | Example `"6305f547-a117-46c0-811c-4395f19f91db"`. |
| `reference` | string \| null | yes |  |
| `importance` | "high" \| "normal" \| "low" \| null | yes |  |
| `inReplyTo` | string \| null | yes |  |
| `references` | string[] | yes |  |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `from_not_allowed`, `attachments_too_large`, `template_account_mismatch`, `template_and_inline_fields`, `invalid_template`, `params_too_large`, `template_render_failed`, `provider_rejected`, `provider_unsupported`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `provider_forbidden`
  - 404: `account_not_found`, `provider_not_found`, `draft_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`, `provider_conflict`, `mail_permission_missing`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `unknown_reply_target`, `unknown_template`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Delete a draft

`DELETE /v1/accounts/{accountId}/drafts/{messageId}`

TypeScript SDK method: `workwae.drafts.delete()`

Required scope: `write`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `messageId` | path | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |

### Responses

- **204** OK (application/json, any)
- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `provider_rejected`, `provider_unsupported`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `provider_forbidden`
  - 404: `account_not_found`, `draft_not_found`, `provider_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `mail_permission_missing`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`, `provider_conflict`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Send a draft

`POST /v1/accounts/{accountId}/drafts/{messageId}/send`

TypeScript SDK method: `workwae.drafts.send()`

A message without a sendAt later than the account's undo window (undoSendSeconds) from now waits out the window; undoUntil says until when cancelling the entry (DELETE .../outbox/{outboxId}) undoes the send. With tracking, the HTML part gets a 1x1 pixel (opens) and its http(s) links point at Workwae's redirect (clicks), reported as message.opened and message.clicked and counted on the outbox entry; text parts are left as they are. With clicks, tracking.honeypot (else the account's trackingHoneypot) also adds one hidden link only machines follow; it does nothing without clicks, so asking for it with clicks off is refused rather than ignored. Tracking is per message, not per recipient: every recipient gets the same MIME. A Gmail or Microsoft 365 draft is sent by the provider as it is stored, so it is never tracked (the account's defaults do not apply); an IMAP draft is. A cancelled draft-send leaves the draft in place. With the suppressionCheck setting always, a draft with a to, cc or bcc address on the global list is refused with suppressed, and fails likewise at delivery.

Required scope: `send`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `messageId` | path | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |

### Request body

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `sendAt` | string (date-time) | no | Example `"2026-05-04T09:30:00.000Z"`. |
| `reference` | string | no | At most 255 characters. |
| `tracking` | object | no |  |
| `tracking.opens` | boolean | no |  |
| `tracking.clicks` | boolean | no |  |
| `tracking.honeypot` | boolean | no |  |

### Responses

- **201** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `accountId` | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `status` | "queued" \| "sending" \| "sent" \| "failed" \| "cancelled" | yes |  |
| `reference` | string \| null | yes |  |
| `sendAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `attempt` | integer | yes |  |
| `lastError` | string \| null | yes |  |
| `rejectedRecipients` | object[] | yes |  |
| `rejectedRecipients[].address` | string | yes | Example `"ada@example.com"`. |
| `rejectedRecipients[].status` | string \| null | yes |  |
| `rejectedRecipients[].diagnostic` | string \| null | yes |  |
| `providerMessageId` | string \| null | yes |  |
| `internetMessageId` | string \| null | yes | Example `"<CAF3x9a@mail.example.org>"`. |
| `sentAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `sentMessageId` | string (uuid) \| null | yes | Example `"fc74707b-3235-43fd-b38c-4a4b8739faf2"`. |
| `threadId` | string \| null | yes | Example `"18f2a3b4c5d6e7f8"`. |
| `createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `trackOpens` | boolean | yes |  |
| `trackClicks` | boolean | yes |  |
| `trackHoneypot` | boolean | yes |  |
| `humanOpenCount` | integer | yes |  |
| `machineOpenCount` | integer | yes |  |
| `humanClickCount` | integer | yes |  |
| `machineClickCount` | integer | yes |  |
| `firstOpenedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `lastOpenedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `mailMergeId` | string (uuid) \| null | yes | Example `"120f1340-41df-4f7f-83d8-02703098eaba"`. |
| `undoUntil` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `not_a_draft`, `no_recipients`, `suppressed`, `tracking_unsupported`, `honeypot_needs_click_tracking`
  - 401: `unauthenticated`, `api_key_expired`
  - 402: `plan_required`, `spend_cap_reached`, `billing_past_due`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `plan_limit_sends`
  - 404: `account_not_found`, `draft_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `mail_permission_missing`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## List queued and recent sends, newest first

`GET /v1/accounts/{accountId}/outbox`

TypeScript SDK method: `workwae.outbox.list()`

status keeps the entries in that status.

Required scope: `read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `status` | query | "queued" \| "sending" \| "sent" \| "failed" \| "cancelled" | no |  |
| `limit` | query | integer | no | 1 to 200. Default `50`. |
| `cursor` | query | string | no | 1 to 512 characters. Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | object[] | yes |  |
| `items[].id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `items[].accountId` | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `items[].status` | "queued" \| "sending" \| "sent" \| "failed" \| "cancelled" | yes |  |
| `items[].reference` | string \| null | yes |  |
| `items[].sendAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].attempt` | integer | yes |  |
| `items[].lastError` | string \| null | yes |  |
| `items[].rejectedRecipients` | object[] | yes |  |
| `items[].rejectedRecipients[].address` | string | yes | Example `"ada@example.com"`. |
| `items[].rejectedRecipients[].status` | string \| null | yes |  |
| `items[].rejectedRecipients[].diagnostic` | string \| null | yes |  |
| `items[].providerMessageId` | string \| null | yes |  |
| `items[].internetMessageId` | string \| null | yes | Example `"<CAF3x9a@mail.example.org>"`. |
| `items[].sentAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].sentMessageId` | string (uuid) \| null | yes | Example `"fc74707b-3235-43fd-b38c-4a4b8739faf2"`. |
| `items[].threadId` | string \| null | yes | Example `"18f2a3b4c5d6e7f8"`. |
| `items[].createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].trackOpens` | boolean | yes |  |
| `items[].trackClicks` | boolean | yes |  |
| `items[].trackHoneypot` | boolean | yes |  |
| `items[].humanOpenCount` | integer | yes |  |
| `items[].machineOpenCount` | integer | yes |  |
| `items[].humanClickCount` | integer | yes |  |
| `items[].machineClickCount` | integer | yes |  |
| `items[].firstOpenedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].lastOpenedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].mailMergeId` | string (uuid) \| null | yes | Example `"120f1340-41df-4f7f-83d8-02703098eaba"`. |
| `nextCursor` | string \| null | yes | Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `invalid_cursor`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`
  - 404: `account_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Send a message

`POST /v1/accounts/{accountId}/outbox`

TypeScript SDK method: `workwae.outbox.create()`

Queues the message as an outbox entry; delivery is reported with send.sent, send.retrying and send.failed events carrying its id as outboxId, and a later bounce with message.bounced. Delivery is at-least-once, except outcome_unknown (below), and without order across retries: an account's entries are first tried in queue order, but one backing off after a failed attempt does not hold up the later ones. A retry first looks for a copy that already went out. When no SMTP reply comes after the final dot was handed to the operating system (the connection dropped or timed out, or the attempt ran out of time), the server may have accepted the message, so it is not sent again: send.failed carries code outcome_unknown and the client app decides whether to resend. A message without a sendAt later than the account's undo window (undoSendSeconds) from now waits out the window; undoUntil says until when cancelling the entry (DELETE .../outbox/{outboxId}) undoes the send. With tracking, the HTML part gets a 1x1 pixel (opens) and its http(s) links point at Workwae's redirect (clicks), reported as message.opened and message.clicked and counted on the outbox entry; text parts are left as they are. With clicks, tracking.honeypot (else the account's trackingHoneypot) also adds one hidden link only machines follow; it does nothing without clicks, so asking for it with clicks off is refused rather than ignored. Tracking is per message, not per recipient: every recipient gets the same MIME. With listId, content is always rendered, `{{rcpt.unsubscribeUrl}}`, `{{rcpt.address}}` and `{{rcpt.name}}` are the recipient's, and the message carries List-Unsubscribe with that same URL and List-Unsubscribe-Post: List-Unsubscribe=One-Click (RFC 8058). Click tracking never rewrites a List-Unsubscribe URL, so the body's link stays as written. A recipient on that list or on the global list is not sent to, at queue time and again at delivery (send.failed with code suppressed). Without listId the global list is consulted only when the suppressionCheck setting (the account's, else the workspace's) is always: then a send with any to, cc or bcc address on it is refused with suppressed (data.addresses names them) and fails at delivery likewise. Whether the provider's DKIM signature covers the List-Unsubscribe headers is up to its signing. For one message per recipient, see POST .../mail-merges. Content is rendered when the request is taken, so later template edits never change it. An unknown field is refused.

Required scope: `send`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |

### Request body

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `to` | object[] | no | At most 500 items. Default `[]`. |
| `to[].name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `to[].address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `cc` | object[] | no | At most 500 items. Default `[]`. |
| `cc[].name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `cc[].address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `bcc` | object[] | no | At most 500 items. Default `[]`. |
| `bcc[].name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `bcc[].address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `replyTo` | object[] | no | At most 10 items. Default `[]`. |
| `replyTo[].name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `replyTo[].address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `subject` | string | no | At most 998 characters. Example `"Quarterly report"`. |
| `text` | string | no | At most 2097152 characters. |
| `html` | string | no | At most 2097152 characters. |
| `attachments` | object[] | no | At most 50 items. Default `[]`. |
| `attachments[].filename` | string | yes | 1 to 255 characters. |
| `attachments[].contentType` | string | yes | 1 to 255 characters. |
| `attachments[].content` | string | yes |  |
| `attachments[].contentId` | string | no | At most 255 characters. |
| `inReplyToMessageId` | string (uuid) | no | Example `"7edc492b-4897-497f-9af1-f099d7395c7f"`. |
| `from` | object | no |  |
| `from.name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `from.address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `signature` | boolean | no |  |
| `priority` | "high" \| "normal" \| "low" | no | Default `"normal"`. |
| `template` | string (uuid) | no | Example `"3226ecbe-6502-43a4-9cd0-3ae67140750e"`. |
| `render` | object | no |  |
| `render.params` | object | no | Default `{}`. |
| `previewText` | string | no | At most 2000 characters. |
| `format` | "html" \| "markdown" | no |  |
| `sendAt` | string (date-time) | no | Example `"2026-05-04T09:30:00.000Z"`. |
| `reference` | string | no | At most 255 characters. |
| `tracking` | object | no |  |
| `tracking.opens` | boolean | no |  |
| `tracking.clicks` | boolean | no |  |
| `tracking.honeypot` | boolean | no |  |
| `listId` | string | no |  |
| `messageId` | string | no | At most 998 characters. |
| `headers` | object | no |  |
| `calendar` | object | no |  |
| `calendar.method` | "PUBLISH" \| "REQUEST" \| "REPLY" \| "ADD" \| "CANCEL" \| "REFRESH" \| "COUNTER" \| "DECLINECOUNTER" | yes |  |
| `calendar.content` | string | yes | At most 262144 characters. |
| `wait` | integer | no | 1 to 30. |

### Responses

- **201** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `accountId` | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `status` | "queued" \| "sending" \| "sent" \| "failed" \| "cancelled" | yes |  |
| `reference` | string \| null | yes |  |
| `sendAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `attempt` | integer | yes |  |
| `lastError` | string \| null | yes |  |
| `rejectedRecipients` | object[] | yes |  |
| `rejectedRecipients[].address` | string | yes | Example `"ada@example.com"`. |
| `rejectedRecipients[].status` | string \| null | yes |  |
| `rejectedRecipients[].diagnostic` | string \| null | yes |  |
| `providerMessageId` | string \| null | yes |  |
| `internetMessageId` | string \| null | yes | Example `"<CAF3x9a@mail.example.org>"`. |
| `sentAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `sentMessageId` | string (uuid) \| null | yes | Example `"fc74707b-3235-43fd-b38c-4a4b8739faf2"`. |
| `threadId` | string \| null | yes | Example `"18f2a3b4c5d6e7f8"`. |
| `createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `trackOpens` | boolean | yes |  |
| `trackClicks` | boolean | yes |  |
| `trackHoneypot` | boolean | yes |  |
| `humanOpenCount` | integer | yes |  |
| `machineOpenCount` | integer | yes |  |
| `humanClickCount` | integer | yes |  |
| `machineClickCount` | integer | yes |  |
| `firstOpenedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `lastOpenedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `mailMergeId` | string (uuid) \| null | yes | Example `"120f1340-41df-4f7f-83d8-02703098eaba"`. |
| `undoUntil` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `from_not_allowed`, `attachments_too_large`, `template_account_mismatch`, `template_and_inline_fields`, `invalid_template`, `params_too_large`, `template_render_failed`, `no_recipients`, `list_send_recipients`, `suppressed`, `honeypot_needs_click_tracking`, `list_unsubscribe_unavailable`
  - 401: `unauthenticated`, `api_key_expired`
  - 402: `plan_required`, `spend_cap_reached`, `billing_past_due`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `plan_limit_sends`
  - 404: `account_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`, `mail_permission_missing`, `duplicate_message_id`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `unknown_reply_target`, `unknown_template`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Get a send

`GET /v1/accounts/{accountId}/outbox/{outboxId}`

TypeScript SDK method: `workwae.outbox.get()`

One entry with its tracking counts, for as long as the outbox keeps it: a sent message's outboxId names it.

Required scope: `read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `outboxId` | path | string (uuid) | yes | Example `"6305f547-a117-46c0-811c-4395f19f91db"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `accountId` | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `status` | "queued" \| "sending" \| "sent" \| "failed" \| "cancelled" | yes |  |
| `reference` | string \| null | yes |  |
| `sendAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `attempt` | integer | yes |  |
| `lastError` | string \| null | yes |  |
| `rejectedRecipients` | object[] | yes |  |
| `rejectedRecipients[].address` | string | yes | Example `"ada@example.com"`. |
| `rejectedRecipients[].status` | string \| null | yes |  |
| `rejectedRecipients[].diagnostic` | string \| null | yes |  |
| `providerMessageId` | string \| null | yes |  |
| `internetMessageId` | string \| null | yes | Example `"<CAF3x9a@mail.example.org>"`. |
| `sentAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `sentMessageId` | string (uuid) \| null | yes | Example `"fc74707b-3235-43fd-b38c-4a4b8739faf2"`. |
| `threadId` | string \| null | yes | Example `"18f2a3b4c5d6e7f8"`. |
| `createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `trackOpens` | boolean | yes |  |
| `trackClicks` | boolean | yes |  |
| `trackHoneypot` | boolean | yes |  |
| `humanOpenCount` | integer | yes |  |
| `machineOpenCount` | integer | yes |  |
| `humanClickCount` | integer | yes |  |
| `machineClickCount` | integer | yes |  |
| `firstOpenedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `lastOpenedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `mailMergeId` | string (uuid) \| null | yes | Example `"120f1340-41df-4f7f-83d8-02703098eaba"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`
  - 404: `account_not_found`, `send_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Reschedule a queued send

`PATCH /v1/accounts/{accountId}/outbox/{outboxId}`

TypeScript SDK method: `workwae.outbox.reschedule()`

Moves sendAt, earlier or later; a past sendAt sends as soon as possible. Announced as send.rescheduled.

Required scope: `send`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `outboxId` | path | string (uuid) | yes | Example `"6305f547-a117-46c0-811c-4395f19f91db"`. |

### Request body (required)

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `sendAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `accountId` | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `status` | "queued" \| "sending" \| "sent" \| "failed" \| "cancelled" | yes |  |
| `reference` | string \| null | yes |  |
| `sendAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `attempt` | integer | yes |  |
| `lastError` | string \| null | yes |  |
| `rejectedRecipients` | object[] | yes |  |
| `rejectedRecipients[].address` | string | yes | Example `"ada@example.com"`. |
| `rejectedRecipients[].status` | string \| null | yes |  |
| `rejectedRecipients[].diagnostic` | string \| null | yes |  |
| `providerMessageId` | string \| null | yes |  |
| `internetMessageId` | string \| null | yes | Example `"<CAF3x9a@mail.example.org>"`. |
| `sentAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `sentMessageId` | string (uuid) \| null | yes | Example `"fc74707b-3235-43fd-b38c-4a4b8739faf2"`. |
| `threadId` | string \| null | yes | Example `"18f2a3b4c5d6e7f8"`. |
| `createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `trackOpens` | boolean | yes |  |
| `trackClicks` | boolean | yes |  |
| `trackHoneypot` | boolean | yes |  |
| `humanOpenCount` | integer | yes |  |
| `machineOpenCount` | integer | yes |  |
| `humanClickCount` | integer | yes |  |
| `machineClickCount` | integer | yes |  |
| `firstOpenedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `lastOpenedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `mailMergeId` | string (uuid) \| null | yes | Example `"120f1340-41df-4f7f-83d8-02703098eaba"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`
  - 404: `account_not_found`, `send_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `send_not_reschedulable`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Cancel a queued send

`DELETE /v1/accounts/{accountId}/outbox/{outboxId}`

TypeScript SDK method: `workwae.outbox.cancel()`

Undoes a send while it waits for its sendAt.

Required scope: `send`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `outboxId` | path | string (uuid) | yes | Example `"6305f547-a117-46c0-811c-4395f19f91db"`. |

### Responses

- **204** OK (application/json, any)
- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`
  - 404: `account_not_found`, `send_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `send_not_cancellable`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## List a send's opens and clicks

`GET /v1/accounts/{accountId}/outbox/{outboxId}/tracking`

TypeScript SDK method: `workwae.outbox.tracking()`

Newest first. At most 1000 are kept per send (the counts on the entry keep going), each for the tracking retention period. Each event carries what its request showed: the method (GET or HEAD), the Referer and Origin hosts, the mail client (Gmail's image proxy, web or app; Outlook on the web, desktop or mobile; Apple Mail and its Mail Privacy Protection; Yahoo, AOL, Thunderbird, Proton, Fastmail, Zoho, iCloud, a self-hosted webmail; else unknown), the device, OS and browser families, Cloudflare's visitor location (country, region, city, timezone, latitude and longitude, behind a trusted proxy only), the seconds after the send and since the send's previous hit, its sequence number, whether it was conditional, a Range request or a prefetch, the sec-fetch tuple, and the request headers (lower-cased, values cut at 1024 characters, at most 64, never Cookie, Authorization or Proxy-Authorization, forwarding and cf-* headers only from the trusted proxy; the full Referer is only here). Full addresses and headers stay with the tenant for the retention period.

Required scope: `read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `outboxId` | path | string (uuid) | yes | Example `"6305f547-a117-46c0-811c-4395f19f91db"`. |
| `limit` | query | integer | no | 1 to 200. Default `50`. |
| `cursor` | query | string | no | 1 to 512 characters. Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | object[] | yes |  |
| `items[].id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `items[].kind` | "open" \| "click" | yes |  |
| `items[].linkIndex` | integer \| null | yes |  |
| `items[].url` | string \| null | yes |  |
| `items[].occurredAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].userAgent` | string \| null | yes |  |
| `items[].ip` | string \| null | yes |  |
| `items[].actor` | "human" \| "proxy" \| "prefetch" \| "scanner" \| "unknown" | yes |  |
| `items[].reasons` | string[] | yes |  |
| `items[].isMachine` | boolean | yes |  |
| `items[].method` | string | yes |  |
| `items[].refererHost` | string \| null | yes |  |
| `items[].originHost` | string \| null | yes |  |
| `items[].client` | "gmail_proxy" \| "gmail_web" \| "gmail_app" \| "outlook_web" \| "outlook_desktop" \| "outlook_mobile" \| "apple_mail" \| "apple_mail_privacy" \| "yahoo" \| "aol" \| "thunderbird" \| "proton" \| "fastmail" \| "zoho" \| "icloud_web" \| "webmail" \| "unknown" | yes |  |
| `items[].device` | "desktop" \| "mobile" \| "tablet" \| "bot" \| "unknown" | yes |  |
| `items[].os` | "windows" \| "macos" \| "ios" \| "ipados" \| "android" \| "linux" \| "chromeos" \| null | yes |  |
| `items[].browser` | "chrome" \| "edge" \| "firefox" \| "safari" \| "opera" \| "samsung" \| null | yes |  |
| `items[].country` | string \| null | yes |  |
| `items[].region` | string \| null | yes |  |
| `items[].city` | string \| null | yes |  |
| `items[].timezone` | string \| null | yes |  |
| `items[].latitude` | number \| null | yes |  |
| `items[].longitude` | number \| null | yes |  |
| `items[].secondsAfterSend` | number \| null | yes |  |
| `items[].secondsSincePrevious` | number \| null | yes |  |
| `items[].sequence` | integer | yes |  |
| `items[].isConditional` | boolean | yes |  |
| `items[].isRange` | boolean | yes |  |
| `items[].isPrefetch` | boolean | yes |  |
| `items[].secFetch` | object | yes |  |
| `items[].secFetch.dest` | string \| null | yes |  |
| `items[].secFetch.mode` | string \| null | yes |  |
| `items[].secFetch.site` | string \| null | yes |  |
| `items[].secFetch.user` | boolean \| null | yes |  |
| `items[].headers` | object | yes |  |
| `nextCursor` | string \| null | yes | Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `invalid_cursor`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`
  - 404: `account_not_found`, `send_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## List mail merges, newest first

`GET /v1/accounts/{accountId}/mail-merges`

TypeScript SDK method: `workwae.mailMerges.list()`

A merge is kept as long as any of its entries is in the outbox, so it goes with the last of them.

Required scope: `read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `limit` | query | integer | no | 1 to 200. Default `50`. |
| `cursor` | query | string | no | 1 to 512 characters. Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | object[] | yes |  |
| `items[].id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `items[].accountId` | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `items[].reference` | string \| null | yes |  |
| `items[].entryCount` | integer | yes |  |
| `items[].createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].counts` | object | yes |  |
| `items[].counts.queued` | integer | yes |  |
| `items[].counts.sending` | integer | yes |  |
| `items[].counts.sent` | integer | yes |  |
| `items[].counts.failed` | integer | yes |  |
| `items[].counts.cancelled` | integer | yes |  |
| `nextCursor` | string \| null | yes | Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `invalid_cursor`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`
  - 404: `account_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Send one message per recipient (mail merge)

`POST /v1/accounts/{accountId}/mail-merges`

TypeScript SDK method: `workwae.mailMerges.create()`

Each of at most 100 entries becomes its own outbox entry and message, addressed to its to alone, with its own Message-ID, events, bounce matching and tracking; the answer has one result per entry, in order. Content is rendered per entry with its params (a template always; inline content only for entries that carry params, or with listId). An entry that cannot be queued fails alone, its result naming the reason (invalid_recipient, invalid_message_id, duplicate_message_id, template_render_failed, plan_limit_sends once the day's sends run out, suppressed when listId is given and the address is on that list or the global list, or the suppressionCheck setting is always and it is on the global list, internal_error), while the others go ahead; the call itself succeeds. The body is the send body without to, cc, bcc and render: an unknown field is refused. Delivery is at-least-once, except outcome_unknown (below), and without order across retries: an account's entries are first tried in queue order, but one backing off after a failed attempt does not hold up the later ones. A retry first looks for a copy that already went out. When no SMTP reply comes after the final dot was handed to the operating system (the connection dropped or timed out, or the attempt ran out of time), the server may have accepted the message, so it is not sent again: send.failed carries code outcome_unknown and the client app decides whether to resend. A message without a sendAt later than the account's undo window (undoSendSeconds) from now waits out the window; undoUntil says until when cancelling the entry (DELETE .../outbox/{outboxId}) undoes the send. With tracking, the HTML part gets a 1x1 pixel (opens) and its http(s) links point at Workwae's redirect (clicks), reported as message.opened and message.clicked and counted on the outbox entry; text parts are left as they are. With clicks, tracking.honeypot (else the account's trackingHoneypot) also adds one hidden link only machines follow; it does nothing without clicks, so asking for it with clicks off is refused rather than ignored. Tracking is per message, not per recipient: every recipient gets the same MIME. With listId, content is always rendered, `{{rcpt.unsubscribeUrl}}`, `{{rcpt.address}}` and `{{rcpt.name}}` are the recipient's, and the message carries List-Unsubscribe with that same URL and List-Unsubscribe-Post: List-Unsubscribe=One-Click (RFC 8058). Click tracking never rewrites a List-Unsubscribe URL, so the body's link stays as written. A recipient on that list or on the global list is not sent to, at queue time and again at delivery (send.failed with code suppressed). Without listId the global list is consulted only when the suppressionCheck setting (the account's, else the workspace's) is always: then a send with any to, cc or bcc address on it is refused with suppressed (data.addresses names them) and fails at delivery likewise. Whether the provider's DKIM signature covers the List-Unsubscribe headers is up to its signing. What holds for the whole call is checked once and refuses it. Content is rendered when the request is taken, so later template edits never change it. Answers 200 with the merge's id (GET .../mail-merges/{mailMergeId}, POST .../cancel to cancel what is still queued) and a result per entry. A merge is kept as long as any of its entries is in the outbox, so it goes with the last of them.

Required scope: `send`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |

### Request body (required)

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `replyTo` | object[] | no | At most 10 items. Default `[]`. |
| `replyTo[].name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `replyTo[].address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `subject` | string | no | At most 998 characters. Example `"Quarterly report"`. |
| `text` | string | no | At most 2097152 characters. |
| `html` | string | no | At most 2097152 characters. |
| `attachments` | object[] | no | At most 50 items. Default `[]`. |
| `attachments[].filename` | string | yes | 1 to 255 characters. |
| `attachments[].contentType` | string | yes | 1 to 255 characters. |
| `attachments[].content` | string | yes |  |
| `attachments[].contentId` | string | no | At most 255 characters. |
| `inReplyToMessageId` | string (uuid) | no | Example `"7edc492b-4897-497f-9af1-f099d7395c7f"`. |
| `from` | object | no |  |
| `from.name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `from.address` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `signature` | boolean | no |  |
| `priority` | "high" \| "normal" \| "low" | no | Default `"normal"`. |
| `template` | string (uuid) | no | Example `"3226ecbe-6502-43a4-9cd0-3ae67140750e"`. |
| `previewText` | string | no | At most 2000 characters. |
| `format` | "html" \| "markdown" | no |  |
| `sendAt` | string (date-time) | no | Example `"2026-05-04T09:30:00.000Z"`. |
| `reference` | string | no | At most 255 characters. |
| `tracking` | object | no |  |
| `tracking.opens` | boolean | no |  |
| `tracking.clicks` | boolean | no |  |
| `tracking.honeypot` | boolean | no |  |
| `listId` | string | no |  |
| `entries` | object[] | yes | 1 to 100 items. |
| `entries[].to` | object | yes |  |
| `entries[].to.name` | string | no | At most 256 characters. Example `"Ada Lovelace"`. |
| `entries[].to.address` | string | yes | At most 320 characters. Example `"ada@example.com"`. |
| `entries[].params` | object | no |  |
| `entries[].messageId` | string | no | At most 998 characters. |
| `entries[].sendAt` | string (date-time) | no | Example `"2026-05-04T09:30:00.000Z"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) \| null | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `items` | object[] | yes |  |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `from_not_allowed`, `attachments_too_large`, `template_account_mismatch`, `template_and_inline_fields`, `invalid_template`, `params_too_large`, `template_render_failed`, `honeypot_needs_click_tracking`, `list_unsubscribe_unavailable`
  - 401: `unauthenticated`, `api_key_expired`
  - 402: `billing_past_due`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`
  - 404: `account_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`, `account_paused`, `account_disabled`, `account_reauth_required`, `account_misconfigured`, `mail_permission_missing`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `unknown_reply_target`, `unknown_template`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Get a mail merge

`GET /v1/accounts/{accountId}/mail-merges/{mailMergeId}`

TypeScript SDK method: `workwae.mailMerges.get()`

The merge with its entries counted by outbox status. A merge is kept as long as any of its entries is in the outbox, so it goes with the last of them.

Required scope: `read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `mailMergeId` | path | string (uuid) | yes | Example `"120f1340-41df-4f7f-83d8-02703098eaba"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `accountId` | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `reference` | string \| null | yes |  |
| `entryCount` | integer | yes |  |
| `createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `counts` | object | yes |  |
| `counts.queued` | integer | yes |  |
| `counts.sending` | integer | yes |  |
| `counts.sent` | integer | yes |  |
| `counts.failed` | integer | yes |  |
| `counts.cancelled` | integer | yes |  |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`
  - 404: `account_not_found`, `mail_merge_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Cancel a mail merge's queued entries

`POST /v1/accounts/{accountId}/mail-merges/{mailMergeId}/cancel`

TypeScript SDK method: `workwae.mailMerges.cancel()`

Cancels every entry of the merge that is still queued, as DELETE .../outbox/{outboxId} does for one (the payload is dropped, send.cancelled is announced for each). Entries being sent, sent, failed or cancelled are left alone; cancelled is how many this call cancelled, 0 when none was left.

Required scope: `send`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `mailMergeId` | path | string (uuid) | yes | Example `"120f1340-41df-4f7f-83d8-02703098eaba"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `cancelled` | integer | yes |  |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`
  - 404: `account_not_found`, `mail_merge_not_found`
  - 409: `idempotency_key_in_progress`, `mail_disabled`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`
