# Mail

Mailboxes, messages and search, drafts and sending, organizing mail, Mail AI and the mail settings.

Web version: https://www.svanja.com/docs/api/mail/

The mail endpoints connect to the mailboxes in your [Inbox](https://app.svanja.com/mail). You can use them to read and search messages, write drafts, send emails, and organize conversations from your own code.

To access mail, you need an API key with the Custom preset and the specific mail areas you want, such as Mail content for reading messages or Mail drafts for writing them. Full access and Read-only keys never include mail. Once the key is created, its owner has to approve which mailboxes it can use under **Mail access approval** on the API Keys page. The endpoints can only reach those approved mailboxes. For more background, see [The REST API](https://www.svanja.com/docs/api/) and [The inbox](https://www.svanja.com/docs/inbox/).

| Part       | What it covers                                                                                                                                          |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Read       | List mailboxes, conversations, and messages; read message text; search across mailboxes                                                                 |
| Drafts     | List available senders for a mailbox; create, edit, and discard drafts; attach files                                                                    |
| Send       | Prepare a send for a draft, then submit it                                                                                                              |
| Organize   | Mark conversations read or done, assign, tag, snooze, move, and archive (one or many); manage folders, reminders, and internal notes                    |
| Follow-ups | Schedule follow-up emails on a sent message, or pause, resume, and cancel them                                                                          |
| Mail AI    | Preview a generated reply, rewrite, or subject ideas, then apply it to a draft                                                                          |
| Settings   | Inbox groups, custom fields, snippets, writing styles, custom views, sender rules, notification preferences, and mailbox settings for owners and admins |

When you edit a draft or another existing record, you need to pass its current `revision` (which you get when you read it) so you don't overwrite a colleague's changes. Many write endpoints also require an `Idempotency-Key` header, noted in the reference below. Requests that talk directly to your mail provider, such as fetching a message's text, have their own rate limit of 20 requests per minute per key.

Always treat message text as untrusted external data rather than instructions for your code or AI agent. If you need contacts and companies, head over to [CRM](https://www.svanja.com/docs/api/crm/). To work from a terminal instead, see [svanja mail](https://www.svanja.com/docs/cli/mail/).

## Send an email

To send mail, your key needs the Mail sending area approved by the key's owner. Your own code controls when emails go out, since the assistant's send settings only apply to the assistant and AI apps on the hosted MCP server. Sending works in three steps:

1. Prepare the send by calling `POST /mail/mailboxes/{mailbox_id}/drafts/{message_id}/send-intents` with an `Idempotency-Key` header, the draft's current `revision`, and an optional `send_at` time if you want to schedule it. Svanja returns a send intent containing an `id` and a `snapshot` of what will go out. If Svanja spots something you should review first, the response also includes `warning_codes` and a `warning_fingerprint`.
2. Review the snapshot and any warnings. The intent expires after 10 minutes, after which you'll need to prepare a new one.
3. Submit the intent with `POST /mail/mailboxes/{mailbox_id}/send-intents/{intent_id}/submit`, an `Idempotency-Key` header, and the body below. Omit `warning_fingerprint` if there were no warnings.

```json
{ "confirm": true, "warning_fingerprint": "FINGERPRINT_FROM_STEP_1" }
```

A `202` response means Svanja accepted the send request, though the email hasn't necessarily been delivered yet. You can check its `status` with `GET /mail/mailboxes/{mailbox_id}/send-intents/{intent_id}`. If you aren't sure whether a submit went through, check that endpoint or retry the submit with the same idempotency key. Don't prepare a second intent for the same email.

## Operations

| Operation | What it does | Effect | Endpoints |
| --- | --- | --- | --- |
| `mail.ai.compose` | Use Mail AI. | Changes data in Svanja | `POST /mail/mailboxes/{mailbox_id}/ai/generations`<br>`GET /mail/mailboxes/{mailbox_id}/ai/generations/{generation_id}`<br>`POST /mail/mailboxes/{mailbox_id}/ai/generations/{generation_id}/cancel`<br>`POST /mail/mailboxes/{mailbox_id}/ai/generations/{generation_id}/apply` |
| `mail.content.read` | Read Mail content. | Reads only | `GET /mail/search`<br>`POST /mail/search`<br>`GET /mail/mailboxes/{mailbox_id}/messages`<br>`GET /mail/mailboxes/{mailbox_id}/messages/{message_id}`<br>`GET /mail/mailboxes/{mailbox_id}/messages/{message_id}/body`<br>`GET /mail/mailboxes/{mailbox_id}/messages/{message_id}/source`<br>`GET /mail/mailboxes/{mailbox_id}/messages/{message_id}/attachments/{attachment_id}` |
| `mail.draft.write` | Create or update Mail drafts. | Changes data in Svanja | `GET /mail/mailboxes/{mailbox_id}/personas`<br>`GET /mail/mailboxes/{mailbox_id}/drafts`<br>`POST /mail/mailboxes/{mailbox_id}/drafts`<br>`GET /mail/mailboxes/{mailbox_id}/drafts/{message_id}`<br>`PATCH /mail/mailboxes/{mailbox_id}/drafts/{message_id}`<br>`DELETE /mail/mailboxes/{mailbox_id}/drafts/{message_id}`<br>`POST /mail/mailboxes/{mailbox_id}/drafts/{message_id}/attachments`<br>`DELETE /mail/mailboxes/{mailbox_id}/drafts/{message_id}/attachments/{ref}` |
| `mail.organize` | Organize Mail. | Changes data in Svanja | `GET /mail/mailboxes/{mailbox_id}/workflow/candidates`<br>`POST /mail/mailboxes/{mailbox_id}/workflow/bulk`<br>`GET /mail/mailboxes/{mailbox_id}/threads/{thread_id}/workflow`<br>`POST /mail/mailboxes/{mailbox_id}/threads/{thread_id}/workflow`<br>`GET /mail/mailboxes/{mailbox_id}/folders`<br>`POST /mail/mailboxes/{mailbox_id}/folders`<br>`PATCH /mail/mailboxes/{mailbox_id}/folders/{folder_id}`<br>`DELETE /mail/mailboxes/{mailbox_id}/folders/{folder_id}`<br>`GET /mail/mailboxes/{mailbox_id}/messages/{message_id}/state`<br>`POST /mail/mailboxes/{mailbox_id}/messages/{message_id}/state`<br>`POST /mail/mailboxes/{mailbox_id}/message-batches`<br>`GET /mail/mailboxes/{mailbox_id}/message-batches/{batch_id}` |
| `mail.read` | Read Mail summaries. | Reads only | `GET /mail/mailboxes`<br>`GET /mail/mailboxes/{mailbox_id}`<br>`GET /mail/threads`<br>`GET /mail/threads/{thread_id}` |
| `mail.send` | Send or schedule Mail. | Acts outside Svanja | `POST /mail/mailboxes/{mailbox_id}/drafts/{message_id}/send-intents`<br>`GET /mail/mailboxes/{mailbox_id}/send-intents/{intent_id}`<br>`POST /mail/mailboxes/{mailbox_id}/send-intents/{intent_id}/submit`<br>`POST /mail/mailboxes/{mailbox_id}/send-intents/{intent_id}/cancel` |

## Endpoints

### Mailboxes

#### GET /api/v1/mail/mailboxes

List mailboxes

Lists visible mailboxes for which the API key's bound visibility user has an explicit content grant. Provider account ids, credentials, metadata payloads, message content, and numeric ids are excluded.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `per_page` | query | integer | no | Page size. Defaults to 25 and is capped at 100. |
| `cursor` | query | string | no | Signed cursor returned by the previous mailbox page. |

#### GET /api/v1/mail/mailboxes/{mailbox_id}

Show mailbox

Shows one granted visible mailbox and local folder summaries. Missing, malformed, cross-team, ungranted, hidden, and deleted mailboxes return resource_not_found after capability checks.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |

### Conversations

#### GET /api/v1/mail/threads

List mail threads

Lists thread summaries from granted visible mailboxes. Message bodies, headers, provider thread/message ids, attachment metadata, drafts, link internals, and numeric ids are excluded.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `per_page` | query | integer | no | Page size. Defaults to 25 and is capped at 100. |
| `cursor` | query | string | no | Signed cursor returned by the previous mail thread page. |
| `mailbox_id` | query | string | no | Filter threads to one granted mailbox public ULID. |
| `folder` | query | string | no | Filter threads to messages placed in one mailbox folder public ULID. |
| `status` | query | one of active, pending | no | Filter threads by conversation status. |
| `assigned_user_id` | query | string | no | Filter threads by assigned public user ULID. |
| `tag_id` | query | string | no | Filter threads by public conversation tag ULID. |
| `created_from` | query | string | no | Inclusive created_at lower bound. Must include seconds and Z or an explicit UTC offset. |
| `created_to` | query | string | no | Inclusive created_at upper bound. Must include seconds and Z or an explicit UTC offset. |
| `updated_from` | query | string | no | Inclusive updated_at lower bound. Must include seconds and Z or an explicit UTC offset. |
| `updated_to` | query | string | no | Inclusive updated_at upper bound. Must include seconds and Z or an explicit UTC offset. |

#### GET /api/v1/mail/threads/{thread_id}

Show mail thread

Shows one granted visible thread summary. Missing, malformed, cross-team, ungranted, hidden, and deleted threads return resource_not_found after capability checks.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `thread_id` | path | string | yes | Mail thread public ULID. This is not the internal numeric thread id. |

### Search

#### GET /api/v1/mail/search

Search only explicitly approved mailboxes

Uses the shared cross-mailbox ranking, scope and filter engine. Mail content capability and bound-user consent are both required. Membership and mailbox grants are rechecked on each page. Current resolved mailboxes, key, actor and filters bind the encrypted cursor. Use POST for large filters/cursors to avoid URL length limits. Results include public thread summaries and matched-message snippets, never provider credentials, internal identifiers or raw diagnostics. Coverage metadata distinguishes partial search and fan-out truncation.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `per_page` | query | integer | no | Page size. Defaults to 25 and is capped at 100. |
| `query` | query | string | no |  |
| `cursor` | query | string | no |  |
| `mailbox_ids` | query | array of string | no |  |
| `collection_ids` | query | array of string | no |  |
| `scope` | query | object | no |  |
| `filters` | query | object | no |  |

#### POST /api/v1/mail/search

Search mail with a JSON query body

Same read-only operation as GET; use this form for large filter arrays or cursors. Requires content consent, does not send mail, and ignores the Idempotency-Key header. Provider search is not wrapped in a replay transaction.

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `query` | string | no |  |
| `cursor` | string or null | no |  |
| `per_page` | integer | no |  |
| `mailbox_ids` | array of string | no |  |
| `collection_ids` | array of string | no |  |
| `scope` | object | no |  |
| `filters` | object | no | Shared Mail filters. Dates use ISO dates; IDs are opaque public IDs. Provider-specific unsupported fields appear in coverage. |

### Messages

#### GET /api/v1/mail/mailboxes/{mailbox_id}/messages

List delegated mailbox messages

Requires the explicitly selected mail_content capability plus session-approved content delegation for this mailbox. Current membership and content grants are rechecked on every request. Existing full-access and read-only presets do not include this capability. Binary downloads require bearer headers; credentials must never be placed in URLs. Message lists use ascending local ingestion order and encrypted, context-bound keyset cursors. Draft content returns the authored body only; staged uploads are not provider attachments.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `per_page` | query | integer | no | Page size. Defaults to 25 and is capped at 100. |
| `thread_id` | query | string | no |  |
| `cursor` | query | string | no |  |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/messages/{message_id}

Show delegated message metadata

Requires the explicitly selected mail_content capability plus session-approved content delegation for this mailbox. Current membership and content grants are rechecked on every request. Existing full-access and read-only presets do not include this capability. Binary downloads require bearer headers; credentials must never be placed in URLs. Message lists use ascending local ingestion order and encrypted, context-bound keyset cursors. Draft content returns the authored body only; staged uploads are not provider attachments.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `message_id` | path | string | yes | Opaque message public id. |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/messages/{message_id}/body

Read sanitized message content

Requires the explicitly selected mail_content capability plus session-approved content delegation for this mailbox. Current membership and content grants are rechecked on every request. Existing full-access and read-only presets do not include this capability. Binary downloads require bearer headers; credentials must never be placed in URLs. Message lists use ascending local ingestion order and encrypted, context-bound keyset cursors. Draft content returns the authored body only; staged uploads are not provider attachments.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `message_id` | path | string | yes | Opaque message public id. |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/messages/{message_id}/source

Download RFC822 source

Requires the explicitly selected mail_content capability plus session-approved content delegation for this mailbox. Current membership and content grants are rechecked on every request. Existing full-access and read-only presets do not include this capability. Binary downloads require bearer headers; credentials must never be placed in URLs. Message lists use ascending local ingestion order and encrypted, context-bound keyset cursors. Draft content returns the authored body only; staged uploads are not provider attachments.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `message_id` | path | string | yes | Opaque message public id. |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/messages/{message_id}/attachments/{attachment_id}

Download message attachment

Requires the explicitly selected mail_content capability plus session-approved content delegation for this mailbox. Current membership and content grants are rechecked on every request. Existing full-access and read-only presets do not include this capability. Binary downloads require bearer headers; credentials must never be placed in URLs. Message lists use ascending local ingestion order and encrypted, context-bound keyset cursors. Draft content returns the authored body only; staged uploads are not provider attachments.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `message_id` | path | string | yes | Opaque message public id. |
| `attachment_id` | path | string | yes | Opaque attachment handle returned by the body projection. |

### Message actions

#### GET /api/v1/mail/mailboxes/{mailbox_id}/messages/{message_id}/state

Read delegated message flags and placements

Requires explicit message_state read consent and current content grants. This capability never sends email and does not require folder-management rights. Reviewed writes require JSON confirm=true, a current revision and an Idempotency-Key. Placement actions require an explicit source folder; permanent deletion requires Trash. Provider IO runs outside replay transactions. Preserve the same key for retries. Unknown outcomes are not resubmitted; a positive provider response is retained before local projection.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `message_id` | path | string | yes |  |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/messages/{message_id}/state

Apply one confirmed revision-bound provider message action

Requires explicit message_state write consent and current content grants. This capability never sends email and does not require folder-management rights. Reviewed writes require JSON confirm=true, a current revision and an Idempotency-Key. Placement actions require an explicit source folder; permanent deletion requires Trash. Provider IO runs outside replay transactions. Preserve the same key for retries. Unknown outcomes are not resubmitted; a positive provider response is retained before local projection.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `message_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `action` | one of mark_read, mark_unread, star, unstar, move, archive, trash, restore, unarchive, unspam, delete_forever, add_labels, remove_labels | yes |  |
| `revision` | string | yes |  |
| `confirm` | always true | yes |  |
| `source_folder_id` | string | no | Required only for move, archive, trash, restore, unarchive, unspam and delete_forever; must be a current exact placement. |
| `target_folder_id` | string | no | Required only for move. |
| `labels` | array of string | no | Required only for add_labels and remove_labels. |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/message-batches

createMailMessageBatch

Explicit message_state write consent and current content grants required. Four exact revision-bound messages maximum; configured provider-call budget must fit 150 seconds. A new key never resumes unknown work. No email is sent.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `action` | one of mark_read, mark_unread, star, unstar, move, archive, trash, restore, unarchive, unspam, delete_forever, add_labels, remove_labels | yes |  |
| `confirm` | always true | yes |  |
| `items` | array of object | yes |  |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/message-batches

listMailMessageBatches

Explicit message_state read consent and current content grants required. Four exact revision-bound messages maximum; configured provider-call budget must fit 150 seconds. A new key never resumes unknown work. No email is sent.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `per_page` | query | integer | no |  |
| `cursor` | query | string | no |  |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/message-batches/{batch_id}

getMailMessageBatch

Explicit message_state read consent and current content grants required. Four exact revision-bound messages maximum; configured provider-call budget must fit 150 seconds. A new key never resumes unknown work. No email is sent.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `batch_id` | path | string | yes |  |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/message-commands

List this key’s message command receipts

Requires explicit message_state read consent and current content grants. This capability never sends email and does not require folder-management rights. Reviewed writes require JSON confirm=true, a current revision and an Idempotency-Key. Placement actions require an explicit source folder; permanent deletion requires Trash. Provider IO runs outside replay transactions. Preserve the same key for retries. Unknown outcomes are not resubmitted; a positive provider response is retained before local projection.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `per_page` | query | integer | no |  |
| `cursor` | query | string | no |  |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/message-commands/{command_id}

Inspect a provider message command without resubmitting

Requires explicit message_state read consent and current content grants. This capability never sends email and does not require folder-management rights. Reviewed writes require JSON confirm=true, a current revision and an Idempotency-Key. Placement actions require an explicit source folder; permanent deletion requires Trash. Provider IO runs outside replay transactions. Preserve the same key for retries. Unknown outcomes are not resubmitted; a positive provider response is retained before local projection.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `command_id` | path | string | yes |  |

### Senders

#### GET /api/v1/mail/mailboxes/{mailbox_id}/personas

List currently granted sender identities

Requires explicit mail_drafts read capability and personal drafts approval. Returns only same-mailbox persona grants; does not authorize sending.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |

### Drafts

#### GET /api/v1/mail/mailboxes/{mailbox_id}/drafts

List delegated drafts and revision tokens

Current personal approval, membership and mailbox grants are required. Bodies are available through the individual draft endpoint.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `per_page` | query | integer | no | Page size. Defaults to 25 and is capped at 100. |
| `cursor` | query | string | no |  |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/drafts

Create a draft without sending

Requires personally approved draft-write authority and an Idempotency-Key. Replays recheck current authority. Reply and forward references remain mailbox scoped. No provider requests occur inside draft mutation transactions.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `persona_id` | string | yes | Current same-mailbox public persona ID with a send-as grant. |
| `subject` | string or null | yes |  |
| `to` | array of object | yes |  |
| `cc` | array of object | yes |  |
| `bcc` | array of object | yes |  |
| `body_mode` | one of plain, rich | yes |  |
| `body_text` | string or null | yes |  |
| `body_html` | string or null | yes | Must be null for plain drafts. Rich HTML is sanitized by the existing draft service. |
| `quote_suppressed` | boolean | no |  |
| `referenced_message_id` | string or null | no | Creation only. Same-mailbox public message ID; requires reference_action. |
| `reference_action` | one of reply, forward | no | Creation only. Reply-all uses reply with explicitly selected recipients. |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/drafts/{message_id}

Read the authored draft snapshot

Returns a revision token and public identities, not browser-only preview URLs or provider credentials.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `message_id` | path | string | yes | Opaque public message identity, scoped to the selected mailbox. |

#### PATCH /api/v1/mail/mailboxes/{mailbox_id}/drafts/{message_id}

Update a revision-bound draft snapshot

Send the complete authored snapshot and its revision. Changed revisions return conflict with draft_revision_changed. Threading and RFC identity cannot be changed. Replays recheck personal approval and current mailbox access.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `message_id` | path | string | yes | Opaque public message identity, scoped to the selected mailbox. |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `persona_id` | string | yes | Current same-mailbox public persona ID with a send-as grant. |
| `subject` | string or null | yes |  |
| `to` | array of object | yes |  |
| `cc` | array of object | yes |  |
| `bcc` | array of object | yes |  |
| `body_mode` | one of plain, rich | yes |  |
| `body_text` | string or null | yes |  |
| `body_html` | string or null | yes | Must be null for plain drafts. Rich HTML is sanitized by the existing draft service. |
| `quote_suppressed` | boolean | no |  |
| `referenced_message_id` | string or null | no | Creation only. Same-mailbox public message ID; requires reference_action. |
| `reference_action` | one of reply, forward | no | Creation only. Reply-all uses reply with explicitly selected recipients. |
| `revision` | string | yes |  |

#### DELETE /api/v1/mail/mailboxes/{mailbox_id}/drafts/{message_id}

Discard a revision-bound draft

Requires current draft-write approval. Frozen or submitted drafts cannot be discarded. Replays retain current authorization checks.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `message_id` | path | string | yes | Opaque public message identity, scoped to the selected mailbox. |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `revision` | string | yes |  |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/drafts/{message_id}/attachments

Add a revision-bound draft attachment

Upload canonical base64 in JSON. Decoded bytes count against the configured draft total (25 MiB by default); empty files are not accepted. MIME type is detected from bytes. Inline images require rich compose and a supported image type. Returns the new draft snapshot, attachment ref and revision. The idempotency hash includes filename, bytes, disposition and revision. Files from an outer transaction rollback are reclaimed by staged-file cleanup.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `message_id` | path | string | yes | Opaque public message identity, scoped to the selected mailbox. |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `revision` | string | yes |  |
| `filename` | string | yes | A filename without directory separators or control characters. |
| `content_base64` | string | yes |  |
| `disposition` | one of attachment, inline | no |  |

#### DELETE /api/v1/mail/mailboxes/{mailbox_id}/drafts/{message_id}/attachments/{ref}

Remove a revision-bound draft attachment

The ref must belong to this draft. Inline images still referenced in HTML cannot be removed; update the authored HTML first. Frozen drafts reject removal. Returns the new draft revision; retries retain current authorization checks.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `message_id` | path | string | yes | Opaque public message identity, scoped to the selected mailbox. |
| `ref` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `revision` | string | yes |  |

### Sending

#### POST /api/v1/mail/mailboxes/{mailbox_id}/drafts/{message_id}/send-intents

Prepare an immutable send for explicit confirmation

Requires separately selected mail_outbound write capability and personal outbound delegation. Binds the current draft revision, sender identity and signature, recipients, attachments, UTC schedule and warning state. Returns an encrypted-at-rest authored snapshot for review and a key/actor-bound intent expiring in ten minutes. This operation performs no provider submission.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `message_id` | path | string | yes | Opaque public message identity, scoped to the selected mailbox. |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `revision` | string | yes |  |
| `send_at` | string or null | no | Future UTC timestamp formatted YYYY-MM-DDTHH:mm:ssZ; omit for immediate sending. |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/send-intents/{intent_id}

Read a prepared send and its current outcome

Available only to the preparing key and bound user with current outbound read approval and mailbox access. An intent or unresolved result is not proof of delivery. A failed preparation needs a new reviewed intent; processing is never permission to resubmit automatically.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `intent_id` | path | string | yes |  |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/send-intents/{intent_id}/submit

Confirm and submit the immutable prepared send

Explicit automation authority must already have been granted by the bound user's session. Requires confirm=true and acknowledgement of the prepared warning fingerprint when warnings exist. Content overrides are rejected. The durable command is claimed before provider IO outside any generic replay transaction. Identical retries return current state without another submission; a different confirmation or request key conflicts. Current authority is rechecked before freeze and after body assembly. An uncertain provider response returns 202 with submission_unresolved=true, never a safe-to-resend indication.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `intent_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `warning_fingerprint` | string or null | no |  |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/send-intents/{intent_id}/cancel

Cancel a submitted scheduled send

Requires explicit confirmation and current outbound write authority. Uses the shared provider cancellation boundary outside the replay transaction. Already canceled outcomes are safe to repeat; an acceptance or dispatch race is not reported as canceled without provider proof.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `intent_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |

### Follow-ups

#### GET /api/v1/mail/mailboxes/{mailbox_id}/messages/{message_id}/follow-up-source

Read the revision needed to create future follow-ups

Requires explicit followups read approval and current content access to the approved mailbox. Full step bodies and visible targets are content-granted data. No provider IDs or run metadata are returned. Source discovery additionally requires the selected sender grant.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `message_id` | path | string | yes |  |
| `persona_id` | query | string | yes |  |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/messages/{message_id}/follow-ups

List follow-ups attached to this message

Requires explicit followups read approval and current content access to the approved mailbox. Full step bodies and visible targets are content-granted data. No provider IDs or run metadata are returned. Source discovery additionally requires the selected sender grant.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `message_id` | path | string | yes |  |
| `per_page` | query | integer | no |  |
| `cursor` | query | string | no |  |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/messages/{message_id}/follow-ups

Approve and create future follow-up emails

Requires explicit followups write approval and a stable retry key. Create, step replacement, resume, reschedule and takeover also require outbound write approval and a current sender grant. Commands bind exact revisions and arming commands require JSON true confirmation. Existing API authority is rechecked except during explicit takeover. Pause, cancel and target removal never transfer sending authority. Workers recheck the bound real key; withdrawal, expiry, removal or rotation blocks unsent work. Takeover does not resume and is unavailable during delivery or after a submitted follow-up. No provider call occurs in these local transactions.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `message_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `persona_id` | string | yes |  |
| `source_revision` | string | yes |  |
| `confirm` | always true | yes |  |
| `unsafe_outcome_override` | boolean | no |  |
| `steps` | array of object | yes |  |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/follow-ups/{sequence_id}

Read full content and current sending authority

Requires explicit followups read approval and current content access to the approved mailbox. Full step bodies and visible targets are content-granted data. No provider IDs or run metadata are returned. Source discovery additionally requires the selected sender grant.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `sequence_id` | path | string | yes |  |

#### PATCH /api/v1/mail/mailboxes/{mailbox_id}/follow-ups/{sequence_id}

Replace follow-up steps before evaluation has begun

Requires explicit followups write approval and a stable retry key. Create, step replacement, resume, reschedule and takeover also require outbound write approval and a current sender grant. Commands bind exact revisions and arming commands require JSON true confirmation. Existing API authority is rechecked except during explicit takeover. Pause, cancel and target removal never transfer sending authority. Workers recheck the bound real key; withdrawal, expiry, removal or rotation blocks unsent work. Takeover does not resume and is unavailable during delivery or after a submitted follow-up. No provider call occurs in these local transactions.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `sequence_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `revision` | string | yes |  |
| `confirm` | always true | yes |  |
| `steps` | array of object | yes |  |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/follow-ups/{sequence_id}/runs

Read follow-up delivery history without provider internals

Requires explicit followups read approval and current content access to the approved mailbox. Full step bodies and visible targets are content-granted data. No provider IDs or run metadata are returned. Source discovery additionally requires the selected sender grant.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `sequence_id` | path | string | yes |  |
| `per_page` | query | integer | no |  |
| `cursor` | query | string | no |  |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/follow-ups/{sequence_id}/actions

Pause resume cancel reschedule remove a target or explicitly take over sending

Requires explicit followups write approval and a stable retry key. Create, step replacement, resume, reschedule and takeover also require outbound write approval and a current sender grant. Commands bind exact revisions and arming commands require JSON true confirmation. Existing API authority is rechecked except during explicit takeover. Pause, cancel and target removal never transfer sending authority. Workers recheck the bound real key; withdrawal, expiry, removal or rotation blocks unsent work. Takeover does not resume and is unavailable during delivery or after a submitted follow-up. No provider call occurs in these local transactions.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `sequence_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `action` | one of pause, resume, cancel, reschedule, remove_target, takeover | yes |  |
| `revision` | string | yes |  |
| `until` | string | no |  |
| `confirm` | always true | no |  |
| `due_at` | string | no |  |
| `target_id` | string | no |  |
| `persona_id` | string | no |  |

The fields you need depend on the `action`: pause needs `revision`; resume needs `revision`, `confirm`; cancel needs `revision`; reschedule needs `revision`, `confirm`, `due_at`; remove_target needs `revision`, `target_id`; takeover needs `revision`, `confirm`, `persona_id`.

### Mail AI

#### POST /api/v1/mail/mailboxes/{mailbox_id}/ai/generations

Generate AI writing from personally approved context

Uses the shared AI ledger and provider outside replay transactions. Explicit AI write approval can consume credits. Only preview output is generated; this never sends or silently writes a draft. Draft context requires its current revision. Pending workers recheck the original key, bound user, mailbox grants and revision. Retain the same Idempotency-Key for retries; expired results are not regenerated.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `action` | one of draft_compose, draft_reply, rewrite_body, suggest_subject, alternate_phrasing, adapt_snippet | yes |  |
| `persona_id` | string or null | no |  |
| `draft_id` | string or null | no |  |
| `revision` | string | no |  |
| `thread_id` | string or null | no |  |
| `selected_message_id` | string or null | no |  |
| `snippet_id` | string or null | no |  |
| `voice_id` | string or null | no |  |
| `voice_mode` | one of auto, persona_default, neutral, explicit | no |  |
| `selection_start` | integer or null | no |  |
| `selection_end` | integer or null | no |  |
| `selection_text` | string or null | no |  |
| `instruction` | string or null | no |  |
| `locale` | string or null | no |  |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/ai/generations/{generation_id}

Read an agent-owned AI generation and cached result

Requires AI read approval and current mailbox access. Only the originating key and bound user can read the generation. Output expires independently of the durable status and usage ledger; null output is not a new generation.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `generation_id` | path | string | yes |  |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/ai/generations/{generation_id}/cancel

Request cancellation of an agent-owned AI generation

Requires AI write approval. Pending work becomes canceled; running work records a cancellation request. Billable work already performed remains billable. Terminal outcomes are not changed. Retries use the same command key.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `generation_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/ai/generations/{generation_id}/apply

Apply an exact cached AI preview to its saved draft

Requires both AI write and draft-write personal approval. The target must be the generation's own draft and match the supplied current revision plus its captured generation baseline. Applying never sends. Subject and alternate outputs are selected by server-validated index. Replay preserves the original result without repeating the change.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `generation_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `draft_id` | string | yes |  |
| `revision` | string | yes |  |
| `apply_mode` | one of replace_body, insert_at_cursor, replace_selection, select_subject, select_alternate | yes |  |
| `selected_index` | integer or null | no |  |
| `apply_time_selection_start` | integer or null | no |  |
| `apply_time_selection_end` | integer or null | no |  |
| `body_html` | string or null | no |  |

### Organizing conversations

#### GET /api/v1/mail/mailboxes/{mailbox_id}/workflow/candidates

Read current mailbox assignment candidates and enabled workflow actions

Requires personally approved workflow read access. Returns opaque user IDs for current members with mailbox content access. Does not grant access or change assignment.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/workflow

Read app-local conversation workflow and its revision

Personally approved workflow read access is required. The revision covers status, assignment, snooze, archive metadata and sorted tags; incoming messages do not invalidate it.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/workflow

Apply a revision-bound local conversation action

Requires separate personal workflow write approval and interactive Mail access. Uses shared status, assignment, snooze, tag and queue services. A stale revision conflicts; retries retain the same key. No provider folder move or email submission occurs.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `action` | one of mark_active, mark_pending, assign, unassign, snooze, unsnooze, mark_done, mark_not_done, add_tag, remove_tag, assign_group, unassign_group | yes |  |
| `revision` | string | yes |  |
| `assigned_user_id` | string | no | Required only for assign; opaque current mailbox candidate ID. |
| `snoozed_until` | string | no | Required only for snooze; future timestamp with explicit timezone. |
| `tag_public_id` | string | no | Required only for add_tag or remove_tag. |
| `group_public_id` | string | no | Required only for assign_group. |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/workflow/bulk

Apply one local workflow action to a bounded explicit conversation set

Up to 100 unique opaque thread IDs with individual revisions. Each item returns succeeded or failed with safe reason and fresh workflow for successful rows; missing and stale rows do not undo other items. Current delegated authority is checked before replay and at each row. Use the same retry key; never silently obtain newer revisions. No provider folder moves or sending.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `action` | one of mark_active, mark_pending, assign, unassign, snooze, unsnooze, mark_done, mark_not_done, add_tag, remove_tag, assign_group, unassign_group | yes |  |
| `assigned_user_id` | string | no | Required only for assign. |
| `snoozed_until` | string | no | Required only for snooze. |
| `tag_public_id` | string | no | Required only for add_tag or remove_tag. |
| `group_public_id` | string | no | Required only for assign_group. |
| `rows` | array of object | yes |  |

### Reminders

#### GET /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/reminders

List my personal and shared reminders with bound cursor pagination

Requires reminders read approval. Lists shared reminders and only the approving member's personal reminders, including terminal history. Managers cannot read another member's personal reminders. Pagination is bound to the current actor, mailbox, thread and page size. Does not change snooze or send email.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |
| `per_page` | query | integer | no |  |
| `cursor` | query | string | no |  |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/reminders

Create a personal or shared reminder

Requires reminders write approval, interactive access and a stable retry key. Personal reminders belong only to the approving member. Shared reminders synchronize conversation snooze and may notify eligible people. Due time must include seconds and timezone, be future at execution, and not exceed 2038-01-19T03:14:07Z. Current authority is checked before replay. No outbound email is sent.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `scope` | one of personal, shared | yes |  |
| `condition` | one of unconditional, if_no_reply | yes |  |
| `due_at` | string | yes |  |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/reminders/{reminder_id}

Read my personal or shared reminder

Requires reminders read approval. Returns a shared reminder or the approving member's own personal reminder, including lifecycle and current revision. Another person's personal reminder is not found even for managers. Does not change snooze or send email.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |
| `reminder_id` | path | string | yes |  |

#### PATCH /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/reminders/{reminder_id}

Reschedule or dismiss a reminder at its exact revision

Requires reminders write approval, interactive access, current revision and a stable retry key. Reschedule requires a future due time with seconds and timezone no later than 2038-01-19T03:14:07Z. Dismiss accepts no due time or condition. Shared reminders synchronize only their owned snooze. Stale revisions return 409 reminder_revision_changed; rescheduling after a notification was delivered returns 409 reminder_already_delivered. Current authority is checked before replay. No outbound email is sent.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |
| `reminder_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `action` | one of reschedule, dismiss | yes |  |
| `revision` | string | yes |  |
| `due_at` | string | no |  |
| `condition` | one of unconditional, if_no_reply | no |  |

The fields you need depend on the `action`: reschedule needs `due_at`; dismiss needs nothing else.

#### DELETE /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/reminders/{reminder_id}

Delete a reminder that has not been delivered

Requires reminders write approval, interactive access, current revision and a stable retry key. Only your own personal or shared reminders are eligible. Delivered reminders return 409 reminder_already_delivered; stale revisions return 409 reminder_revision_changed. Clears only the reminder's owned snooze. Current authority is checked before replay, including repeated deletion. No outbound email is sent.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |
| `reminder_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `revision` | string | yes |  |

### Following

#### GET /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/followers

List current conversation followers

Separate following read approval is required. Only current eligible members are returned with opaque IDs and bound cursor pagination.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |
| `per_page` | query | integer | no |  |
| `cursor` | query | string | no |  |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/following

Read your own following state and revision

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/following

Follow or unfollow a conversation as the personally approving member

Requires following write approval and interactive access. Unfollow preserves the shared opt-out from automatic following. No other user may be supplied. Use the current revision and a stable retry key; current authority is checked before replay. A stale revision returns 409 with reason following_revision_changed.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `action` | one of follow, unfollow | yes |  |
| `revision` | string | yes |  |

### Internal notes

#### GET /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/notes

List internal notes with bound cursor pagination

Requires separately selected Mail notes capability and personal approval for this mailbox. Internal collaboration only; mentions can notify and auto-follow eligible people. Author-only edits and manager moderation retain shared domain rules. Current authority is rechecked before replay. Mutations require a stable explicit retry key; never silently refresh revisions.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |
| `per_page` | query | integer | no |  |
| `cursor` | query | string | no |  |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/notes

Create an internal note and optional mentions

Requires separately selected Mail notes capability and personal approval for this mailbox. Internal collaboration only; mentions can notify and auto-follow eligible people. Author-only edits and manager moderation retain shared domain rules. Current authority is rechecked before replay. Mutations require a stable explicit retry key; never silently refresh revisions.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `body_text` | string | yes |  |
| `message_id` | string or null | no |  |
| `mention_user_ids` | array of string | no |  |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/notes/candidates

Read eligible mention candidates

Requires separately selected Mail notes capability and personal approval for this mailbox. Internal collaboration only; mentions can notify and auto-follow eligible people. Author-only edits and manager moderation retain shared domain rules. Current authority is rechecked before replay. Mutations require a stable explicit retry key; never silently refresh revisions.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/notes/read

Mark my mentions in an explicit note set as read

Requires separately selected Mail notes capability and personal approval for this mailbox. Internal collaboration only; mentions can notify and auto-follow eligible people. Author-only edits and manager moderation retain shared domain rules. Current authority is rechecked before replay. Mutations require a stable explicit retry key; never silently refresh revisions.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `note_ids` | array of string | yes |  |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/notes/{note_id}

Read an internal note or redacted tombstone

Requires separately selected Mail notes capability and personal approval for this mailbox. Internal collaboration only; mentions can notify and auto-follow eligible people. Author-only edits and manager moderation retain shared domain rules. Current authority is rechecked before replay. Mutations require a stable explicit retry key; never silently refresh revisions.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |
| `note_id` | path | string | yes |  |

#### PATCH /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/notes/{note_id}

Update my note at its exact revision

Requires separately selected Mail notes capability and personal approval for this mailbox. Internal collaboration only; mentions can notify and auto-follow eligible people. Author-only edits and manager moderation retain shared domain rules. Current authority is rechecked before replay. Mutations require a stable explicit retry key; never silently refresh revisions.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |
| `note_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `revision` | string | yes |  |
| `body_text` | string | no |  |
| `mention_user_ids` | array of string | no |  |

Send at least one of `body_text`, `mention_user_ids`.

#### DELETE /api/v1/mail/mailboxes/{mailbox_id}/threads/{thread_id}/notes/{note_id}

Redact an internal note at its exact revision

Requires separately selected Mail notes capability and personal approval for this mailbox. Internal collaboration only; mentions can notify and auto-follow eligible people. Author-only edits and manager moderation retain shared domain rules. Current authority is rechecked before replay. Mutations require a stable explicit retry key; never silently refresh revisions.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `thread_id` | path | string | yes |  |
| `note_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `revision` | string | yes |  |

### Folders

#### GET /api/v1/mail/mailboxes/{mailbox_id}/folders

List delegated provider folders

Requires explicit folders read approval and current mailbox content access. Full/read-only presets do not grant this capability. Folder names are private content. Command reads are restricted to the original key and member. Polling reconciles durable positive provider evidence only; it never repeats a provider mutation.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `per_page` | query | integer | no |  |
| `cursor` | query | string | no |  |

#### POST /api/v1/mail/mailboxes/{mailbox_id}/folders

Create a confirmed provider folder

Requires explicit folders write approval, interactive mail and current mailbox-management permission and current mailbox content access. Full/read-only presets do not grant this capability. Requires JSON confirm=true and the exact reviewed revision. Provider IO is outside generic replay transactions. Preserve the idempotency key; identical retries return the same receipt without repeating the provider mutation. An unresolved result must not be retried with a new key. Physical folder deletion requires proven empty and childless state; special-use folders are protected.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `name` | string | yes | One folder name segment, not a path. |
| `parent_folder_id` | string | no |  |
| `source_revision` | string | yes |  |
| `confirm` | always true | yes |  |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/folders/capabilities

Read folder capabilities and creation revision

Requires explicit folders read approval and current mailbox content access. Full/read-only presets do not grant this capability. Folder names are private content. Command reads are restricted to the original key and member. Polling reconciles durable positive provider evidence only; it never repeats a provider mutation.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/folders/{folder_id}

Read a folder and its current revision

Requires explicit folders read approval and current mailbox content access. Full/read-only presets do not grant this capability. Folder names are private content. Command reads are restricted to the original key and member. Polling reconciles durable positive provider evidence only; it never repeats a provider mutation.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `folder_id` | path | string | yes |  |

#### PATCH /api/v1/mail/mailboxes/{mailbox_id}/folders/{folder_id}

Rename a confirmed provider folder

Requires explicit folders write approval, interactive mail and current mailbox-management permission and current mailbox content access. Full/read-only presets do not grant this capability. Requires JSON confirm=true and the exact reviewed revision. Provider IO is outside generic replay transactions. Preserve the idempotency key; identical retries return the same receipt without repeating the provider mutation. An unresolved result must not be retried with a new key. Physical folder deletion requires proven empty and childless state; special-use folders are protected.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `folder_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `name` | string | yes |  |
| `revision` | string | yes |  |
| `confirm` | always true | yes |  |

#### DELETE /api/v1/mail/mailboxes/{mailbox_id}/folders/{folder_id}

Delete a confirmed mutable provider folder

Requires explicit folders write approval, interactive mail and current mailbox-management permission and current mailbox content access. Full/read-only presets do not grant this capability. Requires JSON confirm=true and the exact reviewed revision. Provider IO is outside generic replay transactions. Preserve the idempotency key; identical retries return the same receipt without repeating the provider mutation. An unresolved result must not be retried with a new key. Physical folder deletion requires proven empty and childless state; special-use folders are protected.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `folder_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `revision` | string | yes |  |
| `confirm` | always true | yes |  |

#### GET /api/v1/mail/mailboxes/{mailbox_id}/folder-commands/{command_id}

Inspect this key's folder command without resubmitting

Requires explicit folders read approval and current mailbox content access. Full/read-only presets do not grant this capability. Folder names are private content. Command reads are restricted to the original key and member. Polling reconciles durable positive provider evidence only; it never repeats a provider mutation.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes | Mailbox public ULID. This is not the internal numeric mailbox id. |
| `command_id` | path | string | yes |  |

### Snippets and writing styles

#### GET /api/v1/mail/libraries/snippets

List accessible snippets

Requires explicitly selected Custom libraries read ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Results use stable ID ordering with actor/key/filter-bound cursors. Deleted resources are omitted.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `per_page` | query | integer | no |  |
| `cursor` | query | string | no |  |
| `query` | query | string | no | Literal title/shortcut substring, never body search. |
| `scope` | query | one of personal, shared | no |  |
| `category` | query | string | no |  |
| `tag` | query | string | no |  |

#### POST /api/v1/mail/libraries/snippets

Create an accessible snippet

Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `scope` | one of personal, shared | yes |  |
| `title` | string | yes |  |
| `shortcut` | string or null | no |  |
| `body_text` | string or null | no |  |
| `insertion_mode` | one of literal, ai, dual | no |  |
| `ai_instructions` | string or null | no |  |
| `ai_context_policy` | object or null | no |  |
| `default_ai_behavior` | one of literal, adapt | no |  |
| `category` | string or null | no |  |
| `tags` | array or null | no |  |
| `sort_order` | integer or null | no |  |
| `confirm` | always true | yes |  |

#### GET /api/v1/mail/libraries/snippets/{snippet_id}

Read an accessible snippet

Requires explicitly selected Custom libraries read ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Deleted resources return resource_not_found.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `snippet_id` | path | string | yes |  |

#### PATCH /api/v1/mail/libraries/snippets/{snippet_id}

Update an accessible snippet

Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `snippet_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `scope` | one of personal, shared | no |  |
| `title` | string | no |  |
| `shortcut` | string or null | no |  |
| `body_text` | string | no |  |
| `insertion_mode` | one of literal, ai, dual | no |  |
| `ai_instructions` | string or null | no |  |
| `ai_context_policy` | object or null | no |  |
| `default_ai_behavior` | one of literal, adapt | no |  |
| `category` | string or null | no |  |
| `tags` | array or null | no |  |
| `sort_order` | integer or null | no |  |
| `revision` | string | yes |  |
| `confirm` | always true | yes |  |

#### DELETE /api/v1/mail/libraries/snippets/{snippet_id}

Delete an accessible snippet

Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `snippet_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `revision` | string | yes |  |
| `confirm` | always true | yes |  |

#### GET /api/v1/mail/libraries/voices

List accessible writing styles

Requires explicitly selected Custom libraries read ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Results use stable ID ordering with actor/key/filter-bound cursors. Deleted resources are omitted.Role-only administrators receive metadata, never guidance/examples without a direct grant.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `per_page` | query | integer | no |  |
| `cursor` | query | string | no |  |
| `query` | query | string | no | Literal name substring, never guidance search. |
| `archived` | query | one of active, archived, all | no |  |

#### POST /api/v1/mail/libraries/voices

Create an accessible writing style

Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found. Role-only administrators receive metadata, never guidance/examples without a direct grant.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `name` | string | yes |  |
| `description` | string or null | no |  |
| `guidance_text` | string | yes |  |
| `example_text` | string or null | no |  |
| `locale` | string or null | no |  |
| `confirm` | always true | yes |  |

#### GET /api/v1/mail/libraries/voices/{voice_id}

Read an accessible writing style

Requires explicitly selected Custom libraries read ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Deleted resources return resource_not_found. Role-only administrators receive metadata, never guidance/examples without a direct grant.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `voice_id` | path | string | yes |  |

#### PATCH /api/v1/mail/libraries/voices/{voice_id}

Update an accessible writing style

Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found. Role-only administrators receive metadata, never guidance/examples without a direct grant.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `voice_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `name` | string | no |  |
| `description` | string or null | no |  |
| `guidance_text` | string | no |  |
| `example_text` | string or null | no |  |
| `locale` | string or null | no |  |
| `revision` | string | yes |  |
| `confirm` | always true | yes |  |

#### DELETE /api/v1/mail/libraries/voices/{voice_id}

Delete an accessible writing style

Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found. Role-only administrators receive metadata, never guidance/examples without a direct grant. Review personas_using_default before confirmation: archive/delete makes those senders fall back to neutral; restore makes their existing default available again. Restore only unarchives, never undeletes.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `voice_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `revision` | string | yes |  |
| `confirm` | always true | yes |  |

#### POST /api/v1/mail/libraries/voices/{voice_id}/archive

Archive an accessible writing style

Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found. Role-only administrators receive metadata, never guidance/examples without a direct grant. Review personas_using_default before confirmation: archive/delete makes those senders fall back to neutral; restore makes their existing default available again. Restore only unarchives, never undeletes.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `voice_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `revision` | string | yes |  |
| `confirm` | always true | yes |  |

#### POST /api/v1/mail/libraries/voices/{voice_id}/restore

Restore an accessible writing style

Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found. Role-only administrators receive metadata, never guidance/examples without a direct grant. Review personas_using_default before confirmation: archive/delete makes those senders fall back to neutral; restore makes their existing default available again. Restore only unarchives, never undeletes.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `voice_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `revision` | string | yes |  |
| `confirm` | always true | yes |  |

#### PUT /api/v1/mail/libraries/voices/{voice_id}/grants

Replace access to an accessible writing style

Requires explicitly selected Custom libraries write ability and personal team-library approval. Current domain ownership and grants remain authoritative; no mailbox consent is implied. Requires JSON confirm=true and an Idempotency-Key. Updates and lifecycle/grant changes require the exact reviewed revision; empty updates are rejected. Same-key identical retries return encrypted historical receipts without repeating effects, with fresh authority checks. New changes to deleted resources return resource_not_found. Role-only administrators receive metadata, never guidance/examples without a direct grant. This replaces ALL direct grants. Omitted users lose access; select exposes guidance and manage permits editing. The content-free receipt remains replayable after self-removal while the original key retains library write consent.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `voice_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `revision` | string | yes |  |
| `grants` | array of object | yes |  |
| `confirm` | always true | yes |  |

### Inbox groups

#### GET /api/v1/mail/collections

List inbox groups

Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `cursor` | query | string | no |  |
| `per_page` | query | integer | no |  |
| `query` | query | string | no |  |
| `include_archived` | query | boolean | no |  |
| `include_deleted` | query | boolean | no |  |

#### POST /api/v1/mail/collections

Create inbox groups

Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `name` | string | yes |  |
| `slug` | string or null | no | Plain text normalized to a URL-safe slug. |
| `description` | string or null | no |  |
| `color` | string or null | no |  |
| `icon` | string or null | no |  |

#### GET /api/v1/mail/collections/order

Order inbox groups

Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.

#### PUT /api/v1/mail/collections/order

Reorder inbox groups

Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `item_ids` | array of string | yes |  |

#### GET /api/v1/mail/collections/{collection_id}

Show inbox groups

Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `collection_id` | path | string | yes |  |

#### PATCH /api/v1/mail/collections/{collection_id}

Update inbox groups

Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `collection_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `name` | string | no |  |
| `slug` | string or null | no | Plain text normalized to a URL-safe slug. |
| `description` | string or null | no |  |
| `color` | string or null | no |  |
| `icon` | string or null | no |  |

#### DELETE /api/v1/mail/collections/{collection_id}

Delete inbox groups

Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `collection_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### POST /api/v1/mail/collections/{collection_id}/archive

Archive inbox groups

Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `collection_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### POST /api/v1/mail/collections/{collection_id}/unarchive

Unarchive inbox groups

Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `collection_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### POST /api/v1/mail/collections/{collection_id}/restore

Restore inbox groups

Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `collection_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### PUT /api/v1/mail/collections/{collection_id}/mailboxes

Replace approved inbox-group membership

Requires explicit Custom mail_workspace capability and personal workspace consent. Managers can read collection metadata, including empty groups; members only see active groups containing currently granted and content-approved mailboxes. Mailbox projections and counts contain only current content or separately administration-approved mailboxes. Membership replacement additionally requires administration write consent and current management permission: it replaces ONLY the approved administration subset and preserves every unapproved, hidden or deleted mailbox membership. Empty mailbox_ids clears the approved subset, not the whole group. Metadata grants no email access. Writes require confirm=true and Idempotency-Key; all except create bind the exact row and membership revision. Complete reorder includes all non-deleted groups, including archived rows. Fresh authority is checked before replay and after effects. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `collection_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `mailbox_ids` | array of string | yes |  |

### Custom views and saved searches

#### GET /api/v1/mail/saved-items/{kind}

List saved views or searches

Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads/unified_inbox; search accepts mailbox_search/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `kind` | path | one of view, search | yes |  |
| `cursor` | query | string | no |  |
| `per_page` | query | integer | no |  |
| `query` | query | string | no |  |
| `include_archived` | query | boolean | no |  |
| `include_deleted` | query | boolean | no |  |

#### POST /api/v1/mail/saved-items/{kind}

Create saved views or searches

Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads/unified_inbox; search accepts mailbox_search/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `kind` | path | one of view, search | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `name` | string | yes |  |
| `description` | string or null | no |  |
| `color` | string or null | no |  |
| `icon` | string or null | no |  |
| `visibility` | one of personal, shared | no |  |
| `pinned` | boolean | no |  |
| `favorite` | boolean | no |  |
| `surface` | one of mailbox_threads, unified_inbox, mailbox_search, cross_mailbox_search | yes |  |
| `definition` | object | yes |  |

#### GET /api/v1/mail/saved-items/{kind}/order

Order saved views or searches

Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads/unified_inbox; search accepts mailbox_search/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `kind` | path | one of view, search | yes |  |

#### PUT /api/v1/mail/saved-items/{kind}/order

Reorder saved views or searches

Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads/unified_inbox; search accepts mailbox_search/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `kind` | path | one of view, search | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `item_ids` | array of string | yes |  |

#### GET /api/v1/mail/saved-items/{kind}/{saved_id}

Show saved views or searches

Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads/unified_inbox; search accepts mailbox_search/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `kind` | path | one of view, search | yes |  |
| `saved_id` | path | string | yes |  |

#### PATCH /api/v1/mail/saved-items/{kind}/{saved_id}

Update saved views or searches

Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads/unified_inbox; search accepts mailbox_search/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `kind` | path | one of view, search | yes |  |
| `saved_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `name` | string | no |  |
| `description` | string or null | no |  |
| `color` | string or null | no |  |
| `icon` | string or null | no |  |
| `visibility` | one of personal, shared | no |  |
| `pinned` | boolean | no |  |
| `favorite` | boolean | no |  |
| `surface` | one of mailbox_threads, unified_inbox, mailbox_search, cross_mailbox_search | no |  |
| `definition` | object | no |  |

#### DELETE /api/v1/mail/saved-items/{kind}/{saved_id}

Delete saved views or searches

Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads/unified_inbox; search accepts mailbox_search/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `kind` | path | one of view, search | yes |  |
| `saved_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### GET /api/v1/mail/saved-items/{kind}/{saved_id}/open

Open saved views or searches

Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads/unified_inbox; search accepts mailbox_search/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `kind` | path | one of view, search | yes |  |
| `saved_id` | path | string | yes |  |
| `cursor` | query | string | no |  |
| `per_page` | query | integer | no |  |

#### POST /api/v1/mail/saved-items/{kind}/{saved_id}/duplicate

Duplicate saved views or searches

Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads/unified_inbox; search accepts mailbox_search/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `kind` | path | one of view, search | yes |  |
| `saved_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `name` | string or null | no |  |

#### POST /api/v1/mail/saved-items/{kind}/{saved_id}/archive

Archive saved views or searches

Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads/unified_inbox; search accepts mailbox_search/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `kind` | path | one of view, search | yes |  |
| `saved_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### POST /api/v1/mail/saved-items/{kind}/{saved_id}/unarchive

Unarchive saved views or searches

Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads/unified_inbox; search accepts mailbox_search/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `kind` | path | one of view, search | yes |  |
| `saved_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### POST /api/v1/mail/saved-items/{kind}/{saved_id}/restore

Restore saved views or searches

Requires explicit Custom mail_workspace capability and separate personal workspace consent. Only current owned or shared-visible items can be read; only the owner can edit, trash, restore or reorder. Duplicate copies a visible source into a personal item. Opening additionally requires content capability and consent; approved mailbox intersection is applied before query fan-out, caps, counts and cursors. Metadata does not grant email access. Inaccessible stored references are null and has_unavailable_references is true; do not resubmit a redacted definition. Writes require confirm=true and Idempotency-Key, plus the exact revision except create. Reorder requires the complete owned non-deleted kind inventory, including archived rows, and its collection revision. Kind view accepts mailbox_threads/unified_inbox; search accepts mailbox_search/cross_mailbox_search. Cached replay rechecks current authority. Never silently refresh a reviewed revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `kind` | path | one of view, search | yes |  |
| `saved_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

### Custom fields

#### GET /api/v1/mail/custom-field-values/{resource_type}/{resource_id}

Read applicable fields and current values for one resource

Requires explicit Custom custom_fields read capability and personal consent PLUS underlying target access. Contacts/accounts require CRM read consent and current record policy. Conversations require content read consent, current direct grant and the key's approved content mailbox_ids. Mailbox values require administration read consent, separate administration_mailbox_ids and current manageMailbox policy; this does not grant inbox content. Resource types and all IDs are explicit; user values use same-team public user IDs, never numeric IDs. Archived fields retain existing values read-only. Removed resource scopes hide values. Writes require confirm=true, Idempotency-Key and the exact value entry revision from the list; it binds the field definition and current target value. No automatic revision refresh. Clear preserves history. Value/history responses and encrypted replay remain private and freshly authorized.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `resource_type` | path | one of contact, account, conversation, mailbox | yes |  |
| `resource_id` | path | string | yes |  |

#### GET /api/v1/mail/custom-field-values/{resource_type}/{resource_id}/history

Read private custom-field value history for one resource

Requires explicit Custom custom_fields read capability and personal consent PLUS underlying target access. Contacts/accounts require CRM read consent and current record policy. Conversations require content read consent, current direct grant and the key's approved content mailbox_ids. Mailbox values require administration read consent, separate administration_mailbox_ids and current manageMailbox policy; this does not grant inbox content. Resource types and all IDs are explicit; user values use same-team public user IDs, never numeric IDs. Archived fields retain existing values read-only. Removed resource scopes hide values. Writes require confirm=true, Idempotency-Key and the exact value entry revision from the list; it binds the field definition and current target value. No automatic revision refresh. Clear preserves history. Value/history responses and encrypted replay remain private and freshly authorized.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `resource_type` | path | one of contact, account, conversation, mailbox | yes |  |
| `resource_id` | path | string | yes |  |
| `definition_id` | query | string | no |  |
| `per_page` | query | integer | no |  |
| `cursor` | query | string | no |  |

#### PUT /api/v1/mail/custom-field-values/{resource_type}/{resource_id}/{definition_id}

Set one typed custom-field value

Requires explicit Custom custom_fields write capability and personal consent PLUS underlying target access. Contacts/accounts require CRM write consent and current record policy. Conversations require content read consent, current direct grant and the key's approved content mailbox_ids. Mailbox values require administration write consent, separate administration_mailbox_ids and current manageMailbox policy; this does not grant inbox content. Resource types and all IDs are explicit; user values use same-team public user IDs, never numeric IDs. Archived fields retain existing values read-only. Removed resource scopes hide values. Writes require confirm=true, Idempotency-Key and the exact value entry revision from the list; it binds the field definition and current target value. No automatic revision refresh. Clear preserves history. Value/history responses and encrypted replay remain private and freshly authorized.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `resource_type` | path | one of contact, account, conversation, mailbox | yes |  |
| `resource_id` | path | string | yes |  |
| `definition_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | no | Optional key for unsafe bearer writes. Reusing the same key and same canonical body replays the original response for 24 hours; reusing it with a different body returns idempotency_conflict. |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `value` | string or number or boolean or array | yes | Scalar matching the field type; select fields use one option ID or a list; user fields use a current same-team public user ID. Null is not a set value; use clear. |

#### DELETE /api/v1/mail/custom-field-values/{resource_type}/{resource_id}/{definition_id}

Clear one custom-field value while retaining history

Requires explicit Custom custom_fields write capability and personal consent PLUS underlying target access. Contacts/accounts require CRM write consent and current record policy. Conversations require content read consent, current direct grant and the key's approved content mailbox_ids. Mailbox values require administration write consent, separate administration_mailbox_ids and current manageMailbox policy; this does not grant inbox content. Resource types and all IDs are explicit; user values use same-team public user IDs, never numeric IDs. Archived fields retain existing values read-only. Removed resource scopes hide values. Writes require confirm=true, Idempotency-Key and the exact value entry revision from the list; it binds the field definition and current target value. No automatic revision refresh. Clear preserves history. Value/history responses and encrypted replay remain private and freshly authorized.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `resource_type` | path | one of contact, account, conversation, mailbox | yes |  |
| `resource_id` | path | string | yes |  |
| `definition_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | no | Optional key for unsafe bearer writes. Reusing the same key and same canonical body replays the original response for 24 hours; reusing it with a different body returns idempotency_conflict. |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### GET /api/v1/mail/custom-fields

List custom-field definitions

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `per_page` | query | integer | no |  |
| `cursor` | query | string | no |  |
| `query` | query | string | no |  |
| `include_archived` | query | one of 0, 1 | no |  |
| `include_deleted` | query | one of 0, 1 | no |  |
| `resource_type` | query | one of contact, account, conversation, mailbox | no |  |

#### POST /api/v1/mail/custom-fields

Create a custom-field definition

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `label` | string | yes |  |
| `resource_types` | array of one of contact, account, conversation, mailbox | yes |  |
| `type` | one of text, textarea, number, boolean, single_select, multi_select, date, url, email, user | yes |  |
| `field_key` | string or null | no |  |
| `options` | array or null | no |  |

#### GET /api/v1/mail/custom-fields/order

Read the complete active custom-field order for one resource type

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `resource_type` | query | one of contact, account, conversation, mailbox | yes |  |

#### PUT /api/v1/mail/custom-fields/order

Replace the complete active custom-field order

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `resource_type` | one of contact, account, conversation, mailbox | yes |  |
| `field_ids` | array of string | yes |  |

#### GET /api/v1/mail/custom-fields/{definition_id}

Read a custom-field definition

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `definition_id` | path | string | yes |  |

#### PATCH /api/v1/mail/custom-fields/{definition_id}

Update a custom-field definition

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `definition_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `label` | string | no |  |
| `resource_types` | array of one of contact, account, conversation, mailbox | no |  |

#### DELETE /api/v1/mail/custom-fields/{definition_id}

Move a custom-field definition to trash

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `definition_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### DELETE /api/v1/mail/custom-fields/{definition_id}/force

Permanently delete a trashed custom-field definition and all its values and history

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `definition_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### POST /api/v1/mail/custom-fields/{definition_id}/archive

Archive a custom-field definition

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `definition_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### POST /api/v1/mail/custom-fields/{definition_id}/unarchive

Unarchive a custom-field definition

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `definition_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### POST /api/v1/mail/custom-fields/{definition_id}/restore

Restore a trashed custom-field definition

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `definition_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### POST /api/v1/mail/custom-fields/{definition_id}/options

Create a custom-field option

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `definition_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `label` | string | yes |  |

#### PATCH /api/v1/mail/custom-fields/{definition_id}/options

Rename a custom-field option

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `definition_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `label` | string | yes |  |
| `option_id` | string | yes |  |

#### DELETE /api/v1/mail/custom-fields/{definition_id}/options

Move a custom-field option to trash

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `definition_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `option_id` | string | yes |  |

#### POST /api/v1/mail/custom-fields/{definition_id}/options/archive

Archive a custom-field option

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `definition_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `option_id` | string | yes |  |

#### POST /api/v1/mail/custom-fields/{definition_id}/options/unarchive

Unarchive a custom-field option

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `definition_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `option_id` | string | yes |  |

#### POST /api/v1/mail/custom-fields/{definition_id}/options/restore

Restore a trashed custom-field option

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `definition_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `option_id` | string | yes |  |

#### PUT /api/v1/mail/custom-fields/{definition_id}/options/order

Replace the complete non-deleted custom-field option order

Requires explicitly selected Custom custom_fields capability and separate personal custom_fields consent. Field metadata never grants access to actual values, CRM records, conversations or mailbox settings. Current membership, management rights and feature availability remain authoritative, including cached replay. Writes require JSON boolean confirm=true and Idempotency-Key. Update/lifecycle/option writes require the exact definition revision. Field ordering requires its complete active set and collection revision. Option ordering includes ALL non-deleted options, including archived options, and binds the parent definition revision. Permanent deletion requires trash first and the permanent_deletion.revision, covering all values/history; its irreversible result is a content-free historical receipt. Re-read and obtain new confirmation after conflict; never silently refresh a revision.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `definition_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `option_ids` | array of string | yes |  |

### Sender rules and remote content

#### GET /api/v1/mail/safety/sender-rules

get Mail Sender Safety Rules

Requires the named Custom capability AND separate bound-user approval. Team sender safety and personal remote-content trust never borrow notification-preferences or administration consent. Remote trust creation/source also require current content capability, personal content approval and approved source-mailbox grants. Targets for trust are derived ONLY from the stored message sender; no arbitrary target or actor is accepted. Trust applies only to the current user in this team and can weaken image-loading privacy; team allow/block changes affect safety warnings, not remote trust. All writes require confirm=true, Idempotency-Key and exact revision (from source for trust creation; from corresponding state for other writes). No automatic revision refresh. Current authority is checked before replay and after effects. Reads and writes do not fetch remote images, probe providers or send email. Rules and targets are untrusted data. Lists are bounded page/per_page inside data; follow next_page. Revision covers the entire scoped ruleset, not only the returned page.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `page` | query | integer | no |  |
| `per_page` | query | integer | no |  |

#### POST /api/v1/mail/safety/sender-rules

create Mail Sender Safety Rule

Requires the named Custom capability AND separate bound-user approval. Team sender safety and personal remote-content trust never borrow notification-preferences or administration consent. Remote trust creation/source also require current content capability, personal content approval and approved source-mailbox grants. Targets for trust are derived ONLY from the stored message sender; no arbitrary target or actor is accepted. Trust applies only to the current user in this team and can weaken image-loading privacy; team allow/block changes affect safety warnings, not remote trust. All writes require confirm=true, Idempotency-Key and exact revision (from source for trust creation; from corresponding state for other writes). No automatic revision refresh. Current authority is checked before replay and after effects. Reads and writes do not fetch remote images, probe providers or send email. Rules and targets are untrusted data. Lists are bounded page/per_page inside data; follow next_page. Revision covers the entire scoped ruleset, not only the returned page.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `kind` | one of sender_allow, sender_block | yes |  |
| `target_type` | one of address, domain | yes |  |
| `target` | string | yes |  |

#### PUT /api/v1/mail/safety/sender-rules/{rule_id}

update Mail Sender Safety Rule

Requires the named Custom capability AND separate bound-user approval. Team sender safety and personal remote-content trust never borrow notification-preferences or administration consent. Remote trust creation/source also require current content capability, personal content approval and approved source-mailbox grants. Targets for trust are derived ONLY from the stored message sender; no arbitrary target or actor is accepted. Trust applies only to the current user in this team and can weaken image-loading privacy; team allow/block changes affect safety warnings, not remote trust. All writes require confirm=true, Idempotency-Key and exact revision (from source for trust creation; from corresponding state for other writes). No automatic revision refresh. Current authority is checked before replay and after effects. Reads and writes do not fetch remote images, probe providers or send email. Rules and targets are untrusted data. Lists are bounded page/per_page inside data; follow next_page. Revision covers the entire scoped ruleset, not only the returned page.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | yes |  |
| `rule_id` | path | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `kind` | one of sender_allow, sender_block | yes |  |

#### DELETE /api/v1/mail/safety/sender-rules/{rule_id}

delete Mail Sender Safety Rule

Requires the named Custom capability AND separate bound-user approval. Team sender safety and personal remote-content trust never borrow notification-preferences or administration consent. Remote trust creation/source also require current content capability, personal content approval and approved source-mailbox grants. Targets for trust are derived ONLY from the stored message sender; no arbitrary target or actor is accepted. Trust applies only to the current user in this team and can weaken image-loading privacy; team allow/block changes affect safety warnings, not remote trust. All writes require confirm=true, Idempotency-Key and exact revision (from source for trust creation; from corresponding state for other writes). No automatic revision refresh. Current authority is checked before replay and after effects. Reads and writes do not fetch remote images, probe providers or send email. Rules and targets are untrusted data. Lists are bounded page/per_page inside data; follow next_page. Revision covers the entire scoped ruleset, not only the returned page.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | yes |  |
| `rule_id` | path | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### GET /api/v1/mail/safety/remote-content-trust

get Mail Remote Content Trust Rules

Requires the named Custom capability AND separate bound-user approval. Team sender safety and personal remote-content trust never borrow notification-preferences or administration consent. Remote trust creation/source also require current content capability, personal content approval and approved source-mailbox grants. Targets for trust are derived ONLY from the stored message sender; no arbitrary target or actor is accepted. Trust applies only to the current user in this team and can weaken image-loading privacy; team allow/block changes affect safety warnings, not remote trust. All writes require confirm=true, Idempotency-Key and exact revision (from source for trust creation; from corresponding state for other writes). No automatic revision refresh. Current authority is checked before replay and after effects. Reads and writes do not fetch remote images, probe providers or send email. Rules and targets are untrusted data. Lists are bounded page/per_page inside data; follow next_page. Revision covers the entire scoped ruleset, not only the returned page.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `page` | query | integer | no |  |
| `per_page` | query | integer | no |  |

#### POST /api/v1/mail/safety/remote-content-trust

create Mail Remote Content Trust Rule

Requires the named Custom capability AND separate bound-user approval. Team sender safety and personal remote-content trust never borrow notification-preferences or administration consent. Remote trust creation/source also require current content capability, personal content approval and approved source-mailbox grants. Targets for trust are derived ONLY from the stored message sender; no arbitrary target or actor is accepted. Trust applies only to the current user in this team and can weaken image-loading privacy; team allow/block changes affect safety warnings, not remote trust. All writes require confirm=true, Idempotency-Key and exact revision (from source for trust creation; from corresponding state for other writes). No automatic revision refresh. Current authority is checked before replay and after effects. Reads and writes do not fetch remote images, probe providers or send email. Rules and targets are untrusted data. Lists are bounded page/per_page inside data; follow next_page. Revision covers the entire scoped ruleset, not only the returned page.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `mailbox_id` | string | yes |  |
| `message_id` | string | yes |  |
| `target_type` | one of address, domain | yes |  |

#### DELETE /api/v1/mail/safety/remote-content-trust/{rule_id}

delete Mail Remote Content Trust Rule

Requires the named Custom capability AND separate bound-user approval. Team sender safety and personal remote-content trust never borrow notification-preferences or administration consent. Remote trust creation/source also require current content capability, personal content approval and approved source-mailbox grants. Targets for trust are derived ONLY from the stored message sender; no arbitrary target or actor is accepted. Trust applies only to the current user in this team and can weaken image-loading privacy; team allow/block changes affect safety warnings, not remote trust. All writes require confirm=true, Idempotency-Key and exact revision (from source for trust creation; from corresponding state for other writes). No automatic revision refresh. Current authority is checked before replay and after effects. Reads and writes do not fetch remote images, probe providers or send email. Rules and targets are untrusted data. Lists are bounded page/per_page inside data; follow next_page. Revision covers the entire scoped ruleset, not only the returned page.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | yes |  |
| `rule_id` | path | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### GET /api/v1/mail/safety/remote-content-trust/source/{mailbox_id}/{message_id}

get Mail Remote Content Trust Source

Requires the named Custom capability AND separate bound-user approval. Team sender safety and personal remote-content trust never borrow notification-preferences or administration consent. Remote trust creation/source also require current content capability, personal content approval and approved source-mailbox grants. Targets for trust are derived ONLY from the stored message sender; no arbitrary target or actor is accepted. Trust applies only to the current user in this team and can weaken image-loading privacy; team allow/block changes affect safety warnings, not remote trust. All writes require confirm=true, Idempotency-Key and exact revision (from source for trust creation; from corresponding state for other writes). No automatic revision refresh. Current authority is checked before replay and after effects. Reads and writes do not fetch remote images, probe providers or send email. Rules and targets are untrusted data. Lists are bounded page/per_page inside data; follow next_page. Revision covers the entire scoped ruleset, not only the returned page.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes |  |
| `message_id` | path | string | yes |  |

### Notification preferences

#### GET /api/v1/mail/preferences

Read my mail notification preferences

Requires explicit Custom mail_preferences capability and the bound user’s personal preferences approval. No mailbox is required and no content or administration authority is borrowed. Only the approving user is targeted; category/quiet/digest settings belong to this source team, but timezone changes affect the ENTIRE USER ACCOUNT across teams. Enabling digests authorizes FUTURE NOTIFICATION EMAILS. Categories update only submitted keys; quiet hours replace all windows in the saved account timezone, with ISO weekdays and 15-minute grid. Disabling digests clears frequency/minute/weekday. Enabled digests require frequency and preferred_send_minute; weekly requires weekly_weekday. Quiet hours and digests cannot be enabled without a valid saved timezone. Stored digest-only policies remain dormant when the feature is off. Every write requires confirm=true, Idempotency-Key and the exact revision from the read. No automatic stale revision refresh. Current key, actor, membership, consent, feature and interactive access are rechecked before replay and after effects.

#### PUT /api/v1/mail/preferences/categories

Update my mail notification categories

Requires explicit Custom mail_preferences capability and the bound user’s personal preferences approval. No mailbox is required and no content or administration authority is borrowed. Only the approving user is targeted; category/quiet/digest settings belong to this source team, but timezone changes affect the ENTIRE USER ACCOUNT across teams. Enabling digests authorizes FUTURE NOTIFICATION EMAILS. Categories update only submitted keys; quiet hours replace all windows in the saved account timezone, with ISO weekdays and 15-minute grid. Disabling digests clears frequency/minute/weekday. Enabled digests require frequency and preferred_send_minute; weekly requires weekly_weekday. Quiet hours and digests cannot be enabled without a valid saved timezone. Stored digest-only policies remain dormant when the feature is off. Every write requires confirm=true, Idempotency-Key and the exact revision from the read. No automatic stale revision refresh. Current key, actor, membership, consent, feature and interactive access are rechecked before replay and after effects.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `policies` | object | yes |  |

#### PUT /api/v1/mail/preferences/quiet-hours

Update my mail notification quiet hours

Requires explicit Custom mail_preferences capability and the bound user’s personal preferences approval. No mailbox is required and no content or administration authority is borrowed. Only the approving user is targeted; category/quiet/digest settings belong to this source team, but timezone changes affect the ENTIRE USER ACCOUNT across teams. Enabling digests authorizes FUTURE NOTIFICATION EMAILS. Categories update only submitted keys; quiet hours replace all windows in the saved account timezone, with ISO weekdays and 15-minute grid. Disabling digests clears frequency/minute/weekday. Enabled digests require frequency and preferred_send_minute; weekly requires weekly_weekday. Quiet hours and digests cannot be enabled without a valid saved timezone. Stored digest-only policies remain dormant when the feature is off. Every write requires confirm=true, Idempotency-Key and the exact revision from the read. No automatic stale revision refresh. Current key, actor, membership, consent, feature and interactive access are rechecked before replay and after effects.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `enabled` | boolean | yes |  |
| `windows` | array of object | yes |  |

#### PUT /api/v1/mail/preferences/digest-schedule

Update my mail notification digest schedule

Requires explicit Custom mail_preferences capability and the bound user’s personal preferences approval. No mailbox is required and no content or administration authority is borrowed. Only the approving user is targeted; category/quiet/digest settings belong to this source team, but timezone changes affect the ENTIRE USER ACCOUNT across teams. Enabling digests authorizes FUTURE NOTIFICATION EMAILS. Categories update only submitted keys; quiet hours replace all windows in the saved account timezone, with ISO weekdays and 15-minute grid. Disabling digests clears frequency/minute/weekday. Enabled digests require frequency and preferred_send_minute; weekly requires weekly_weekday. Quiet hours and digests cannot be enabled without a valid saved timezone. Stored digest-only policies remain dormant when the feature is off. Every write requires confirm=true, Idempotency-Key and the exact revision from the read. No automatic stale revision refresh. Current key, actor, membership, consent, feature and interactive access are rechecked before replay and after effects.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `enabled` | boolean | yes |  |
| `frequency` | one of daily, weekly | no |  |
| `preferred_send_minute` | integer or null | no |  |
| `weekly_weekday` | integer or null | no |  |

#### PUT /api/v1/mail/preferences/timezone

Update my mail notification timezone

Requires explicit Custom mail_preferences capability and the bound user’s personal preferences approval. No mailbox is required and no content or administration authority is borrowed. Only the approving user is targeted; category/quiet/digest settings belong to this source team, but timezone changes affect the ENTIRE USER ACCOUNT across teams. Enabling digests authorizes FUTURE NOTIFICATION EMAILS. Categories update only submitted keys; quiet hours replace all windows in the saved account timezone, with ISO weekdays and 15-minute grid. Disabling digests clears frequency/minute/weekday. Enabled digests require frequency and preferred_send_minute; weekly requires weekly_weekday. Quiet hours and digests cannot be enabled without a valid saved timezone. Stored digest-only policies remain dormant when the feature is off. Every write requires confirm=true, Idempotency-Key and the exact revision from the read. No automatic stale revision refresh. Current key, actor, membership, consent, feature and interactive access are rechecked before replay and after effects.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `timezone` | string | yes | Valid IANA timezone, for example Europe/Berlin. Changes the user's entire account, not only this team. |

### Mailbox settings and connection

#### GET /api/v1/mail/administration/connection-handoff

Get private human connection setup navigation

Read-only, no provisioning or credential effects. Requires Custom mail_administration read and matching personal administration approval, plus current Mail management. Existing-mailbox actions require its separate administration approval. Password entry, OAuth/MFA consent and credential rotation happen only after the human opens this signed-in settings link and explicitly submits the private form. This link grants no authority, is not provider readiness or completion evidence, and never automatically approves new mailbox content/API access.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `action` | query | one of connect_oauth, connect_credentials, connect_shared, reauthorize, rotate_credentials | yes |  |
| `mailbox_id` | query | string | no | Required only for reauthorize and rotate_credentials; prohibited for new connections. |

#### POST /api/v1/mail/administration/mailboxes/{mailbox_id}/connection/commands/{command_id}/acknowledge

Acknowledge an unresolved connection outcome without retrying it

Requires current management authority and this original key/user receipt. Explicitly acknowledges possible partial or unknown changes and releases the admission fence, without provider HTTP, retries, cancellation or certification of success. confirm:true, reconciliation_revision as revision, and retained Idempotency-Key are required. Resync/flush remain superadmin-only. Interrupted started commands additionally require current superadmin, absence of any active team connection lock and a 240-second quarantine. Original steps and command_completed:false remain preserved. Same intent replays with fresh authority; changed acknowledgement or stale revision conflicts.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |
| `command_id` | path | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### POST /api/v1/mail/administration/mailboxes/{mailbox_id}/connection/{operation}

Execute one reviewed connection operation

Requires Custom mail_administration capability, separate bound-user approval for this exact administration_mailbox_ids entry, and current management policy. Does not borrow content grants. A durable receipt records each provider mutation separately before transport and never retries provider effects automatically. A completed command is not a guarantee that provider synchronization has finished. started or needs_attention may include partial local/provider changes; inspect steps and reconcile before any new command. New keys cannot bypass an unresolved command for this mailbox. Replay rechecks current authority. Reads of receipts are bound to the original key and user. No credentials or raw provider payloads are returned. Disconnect can cancel queued mail; flush rebuilds local sync state. Resync and flush additionally require the bound user's current superadmin role. acknowledged_at records explicit acknowledgement of an uncertain outcome, never success. reconciliation_revision binds a later human-approved acknowledgement to this exact receipt and mailbox state.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes |  |
| `operation` | path | one of reconnect, disconnect, enable, repair, resync, flush | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### GET /api/v1/mail/administration/mailboxes/{mailbox_id}/connection/commands/{command_id}

Read your connection operation receipt

Requires Custom mail_administration capability, separate bound-user approval for this exact administration_mailbox_ids entry, and current management policy. Does not borrow content grants. A durable receipt records each provider mutation separately before transport and never retries provider effects automatically. A completed command is not a guarantee that provider synchronization has finished. started or needs_attention may include partial local/provider changes; inspect steps and reconcile before any new command. New keys cannot bypass an unresolved command for this mailbox. Replay rechecks current authority. Reads of receipts are bound to the original key and user. No credentials or raw provider payloads are returned. Disconnect can cancel queued mail; flush rebuilds local sync state. Resync and flush additionally require the bound user's current superadmin role. acknowledged_at records explicit acknowledgement of an uncertain outcome, never success. reconciliation_revision binds a later human-approved acknowledgement to this exact receipt and mailbox state.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes |  |
| `command_id` | path | string | yes |  |

#### GET /api/v1/mail/administration/doctor

Read paginated redacted stored Mail diagnostics

Requires separate mail_administration read capability, explicit administration_mailbox_ids approval, and current management policy. Only approved managed mailboxes are included. Stored snapshot only: no live provider probe, message reads, credentials, repairs, or delivery guarantee. Each row includes health, explicit reader and available sender counts, runtime feature flags, observation time, and suggested next action. Follow the bound cursor to inspect the complete approved subset; an empty or partial page is not a whole-team readiness verdict. All authority is rechecked before returning data.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `per_page` | query | integer | no |  |
| `cursor` | query | string | no |  |

#### GET /api/v1/mail/administration/mailboxes

List separately approved manageable mailboxes

Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `per_page` | query | integer | no |  |
| `cursor` | query | string | no |  |

#### GET /api/v1/mail/administration/mailboxes/{mailbox_id}

Read exact mailbox settings

Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes |  |

#### GET /api/v1/mail/administration/mailboxes/{mailbox_id}/personas

List managed sender settings

Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes |  |
| `per_page` | query | integer | no |  |
| `cursor` | query | string | no |  |

#### GET /api/v1/mail/administration/mailboxes/{mailbox_id}/personas/{persona_id}

Read exact sender settings

Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes |  |
| `persona_id` | path | string | yes |  |

#### PUT /api/v1/mail/administration/mailboxes/{mailbox_id}/grants

Replace the complete mailbox read-access list; removed users also lose dependent sending and collaboration access

Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `user_ids` | array of string | yes |  |

#### PUT /api/v1/mail/administration/mailboxes/{mailbox_id}/personas/{persona_id}/grants

Replace the complete sender send-as access list; every selected user must already have mailbox read access

Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes |  |
| `persona_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `user_ids` | array of string | yes |  |

#### PUT /api/v1/mail/administration/mailboxes/{mailbox_id}/personas/{persona_id}/signature

Set or clear a sender signature using sanitized HTML; does not send email

Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes |  |
| `persona_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `signature_html` | string or null | yes |  |

#### POST /api/v1/mail/administration/mailboxes/{mailbox_id}/personas/{persona_id}/enable

Enable an available-to-enable provider-discovered alias; not a reconnect and does not grant send-as access

Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes |  |
| `persona_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |

#### PUT /api/v1/mail/administration/mailboxes/{mailbox_id}/personas/{persona_id}/default-voice

Set or clear a sender default writing style; requires BOTH libraries and separately approved mailbox administration

Requires Custom mail_administration capability, personal approval for the exact administration_mailbox_ids and current Mail management policy. Settings consent and content consent are separate: no inbox access or provider credentials are returned. All IDs are public IDs. Grant replacement uses the COMPLETE desired current-team user list; omitted mailbox readers also lose dependent sender/collaboration access. Signatures use shared HTML sanitization. Alias enable is local activation only, not a reconnect or grant. Default writing style additionally requires libraries write capability and personal libraries approval, current persona/style administration, and voice_revision from the style read for a non-null voice_id; null clears the default. Every write requires confirm=true, Idempotency-Key and the exact settings revision. Stale proposals are rejected, never automatically refreshed. Current actor, policy, selected mailbox consent and target-style authority are checked before cached replay and after the effect. These local operations never call the mail provider or send email.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `mailbox_id` | path | string | yes |  |
| `persona_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

| Body field | Type | Required | Notes |
| --- | --- | --- | --- |
| `confirm` | always true | yes |  |
| `revision` | string | yes |  |
| `voice_id` | string or null | yes |  |
| `voice_revision` | string or null | no |  |
