The Sendmux Mailbox API is for mailbox-scoped credentials. Use it when a client should act only as the mailbox tied to its API key, not manage team-wide resources. Team-wide mailbox provisioning stays in the Management API. High-volume provider-routed sending stays in the Sending API.Documentation Index
Fetch the complete documentation index at: https://docs.sendmux.ai/llms.txt
Use this file to discover all available pages before exploring further.
Base URL
All Mailbox API requests should be made to:Authentication
Authenticate with a mailbox credential from the Sendmux app. Pass it as a Bearer token in theAuthorization header.
Current endpoints
| Endpoint | Purpose |
|---|---|
GET /mailbox/me | Return the mailbox associated with the bearer token. |
GET /mailbox/session | Return supported capabilities, limits, and current state tokens. |
GET /mailbox/identity | Return the mailbox’s default sender identity and signatures. |
PATCH /mailbox/identity | Update the mailbox’s sender name and signatures. |
GET /mailbox/identities | List sender identities available to the mailbox. |
GET /mailbox/messages | List messages with filters, sorting, and cursor pagination. |
POST /mailbox/messages:batch-get | Read exact message IDs with optional raw or clean body output. |
POST /mailbox/messages:batch-update | Update allowed flags for multiple messages. |
POST /mailbox/messages:batch-delete | Move or permanently delete multiple messages. |
GET /mailbox/messages/count | Count messages matching filters without returning rows. |
GET /mailbox/messages/query-changes | Read filtered message-list index changes since a prior state. |
GET /mailbox/messages/search-snippets | Return subject and preview snippets for text searches. |
GET /mailbox/messages/{message_id} | Read a message, including bodies and attachment metadata. |
GET /mailbox/messages/{message_id}/body | Read raw body text, HTML, or both without cleaning. |
GET /mailbox/messages/{message_id}/content | Read clean message content with body-cleaning controls. |
PATCH /mailbox/messages/{message_id} | Update mutable message flags with state-safe conflict handling. |
DELETE /mailbox/messages/{message_id} | Move or delete a message with state-safe conflict handling. |
POST /mailbox/attachments:upload | Upload an attachment for a later send request. |
GET /mailbox/messages/{message_id}/attachments/{attachment_id} | Download an attachment. |
POST /mailbox/messages/send | Send from the authenticated mailbox. |
GET /mailbox/threads | List conversation threads with filters and cursor pagination. |
GET /mailbox/threads/{thread_id} | Read thread metadata, message IDs, participants, and state. |
GET /mailbox/threads/{thread_id}/messages | List message summaries for one thread. |
GET /mailbox/threads/{thread_id}/content | Read clean message content for one thread with cursor pagination. |
GET /mailbox/folders | List folders. |
POST /mailbox/folders | Create a folder. |
GET /mailbox/folders/changes | Read folder object changes since a prior folder state. |
GET /mailbox/folders/query-changes | Read folder-list index changes since a prior query state. |
GET /mailbox/folders/{folder_id} | Read one folder. |
PATCH /mailbox/folders/{folder_id} | Update a folder with state-safe conflict handling. |
DELETE /mailbox/folders/{folder_id} | Delete an empty custom folder with state-safe conflict handling. |
GET /mailbox/submissions | List send submissions with filters and cursor pagination. |
GET /mailbox/submissions/changes | Read submission object changes since a prior state. |
GET /mailbox/submissions/{submission_id} | Read one send submission. |
GET /mailbox/quotas | List mailbox quota usage and limits. |
GET /mailbox/quotas/changes | Read quota object changes since a prior quota state. |
GET /mailbox/usage | Read a compact usage view derived from quota records. |
GET /mailbox/changes | Read message changes, or a typed resource state map. |
GET /mailbox/events | Stream mailbox events with Server-Sent Events. |
Capability discovery
UseGET /mailbox/session before planning a mailbox workflow. It returns the
mailbox tied to the credential, supported Mailbox API features, current state
tokens, request limits, and gated features. A gated feature is intentionally
unavailable through the Mailbox API.
gated fields are true when a feature is intentionally unavailable.Operational resources
Operational endpoints expose what an agent needs to send safely and monitor mailbox health without adding mutation authority.Sender identities
UseGET /mailbox/identity to read the mailbox’s default sender name and
signatures. Use PATCH /mailbox/identity to update name,
text_signature, and html_signature.
Mailbox API sends use this sender name by default and append the matching
plain text or HTML signature when the send body includes that format.
GET /mailbox/identities lists all sender identities available to the
authenticated mailbox.
Send submissions
Use submissions to inspect queued, sent, failed, or cancelled send lifecycle records separately from themessages/send request that created them.
| Parameter | Purpose |
|---|---|
identity_ids | Comma-separated identity IDs. |
email_ids | Comma-separated message IDs. |
thread_ids | Comma-separated thread IDs. |
undo_status | Match a specific submission undo state. |
after | Match submissions sent at or after this time. |
before | Match submissions sent before this time. |
cursor | Continue from a previous page. |
limit | Return 1 to 100 submissions. |
sort_by | Sort by send_at, email_id, or thread_id. |
sort_direction | Sort asc or desc. |
GET /mailbox/submissions/{submission_id}. Poll
GET /mailbox/submissions/changes?since_state=... to sync submission object
changes.
Quotas and usage
Use quotas for detailed limits andusage for a compact health view.
| Parameter | Purpose |
|---|---|
name | Match quota name text. |
scope | Match account, domain, or global. |
resource_type | Match count or octets. |
type | Match a resource family, such as Mail. |
cursor | Continue from a previous page. |
limit | Return 1 to 100 quotas. |
sort_by | Sort by name or used. |
sort_direction | Sort asc or desc. |
GET /mailbox/quotas/changes?since_state=... to sync quota changes.
Thread APIs
Use thread endpoints when you need conversation-level context without fetching every body.List threads
| Parameter | Purpose |
|---|---|
q | Search common address, subject, and body text. |
participant | Match sender or recipient addresses. |
folder_id | Restrict results to one folder. |
is_unread | Match unread or read threads. |
has_attachment | Match threads with or without attachment metadata. |
after | Match threads with messages at or after this time. |
before | Match threads with messages before this time. |
cursor | Continue from a previous page. |
limit | Return 1 to 100 threads. |
sort_direction | Sort by most recent message, desc or asc. |
Read a thread
message_ids in chronological order. Use
GET /mailbox/threads/{thread_id}/messages for paginated message summaries, or
GET /mailbox/threads/{thread_id}/content when you need cleaned bodies.
Retrieval precision APIs
Use exact retrieval and count endpoints when you already know what you need. This keeps client payloads small and avoids fetching message bodies just to answer count or search-preview questions.Rich message filters
GET /mailbox/messages and GET /mailbox/messages/count support these
filters. GET /mailbox/messages/search-snippets and
GET /mailbox/messages/query-changes support the same filters except
thread_id; pass message_ids when you already know the exact messages to
snippet.
| Parameter | Purpose |
|---|---|
folder_id | Restrict results to one folder. |
thread_id | Restrict list/count to one thread. Not supported for snippets. |
q | Search common address, subject, and body text. |
from | Search the From header. |
to | Search the To header. |
cc | Search the Cc header. |
bcc | Search the Bcc header. |
subject | Search subject text. |
body | Search body text. |
header_name | Match messages with a specific header. |
header_value | Match text inside header_name. |
min_size_bytes | Match messages at least this many bytes. |
max_size_bytes | Match messages smaller than this many bytes. |
keyword | Match messages with a keyword, such as $seen. |
not_keyword | Match messages without a keyword. |
after | Match messages received at or after this timestamp. |
before | Match messages received before this timestamp. |
has_attachment | Match messages with or without attachments. |
is_unread | Match unread or read messages. |
thread_id uses the thread’s message order and cannot be combined with other
message filters. Use the thread content endpoint when you need cleaned bodies
for one conversation.Count messages
Use the count endpoint when you only need the number of matches.Search snippets
Use snippets to decide which matching messages deserve a full fetch. Snippets may include<mark> tags around matched terms.
message_ids as a comma-separated list when you already have exact
messages:
Batch get messages
Use batch get when you have exact IDs and want one request instead of one call per message.body_mode | Output |
|---|---|
none | Message summaries only. |
raw | Message summaries plus raw_body. Supports part=text, html, or both. |
clean_json | Message summaries plus content. Supports the clean controls below. |
Batch update messages
Use batch update to set allowed flags and keywords on up to 100 messages in one state-safe request.keywords is a map where true sets a keyword and false
clears it. Keyword names are normalised to lowercase. Lifecycle keywords such
as $draft are read-only.
Batch delete messages
Use batch delete to move up to 100 messages to Trash. Setpermanent=true only
when the messages should be permanently removed.
Batch update and delete accept
if_in_state for stale-write protection. Use
the latest message state from message lists, detail reads, batch reads, or
change endpoints.Message body APIs
Use the raw body endpoint when you need the message body exactly as available from the mailbox.| Parameter | Values | Default | Applies to |
|---|---|---|---|
part | auto, text, html | auto | Message content, thread content, batch clean JSON |
max_body_chars | 1 to 1000000 | 100000 for messages, 25000 per thread message | Raw body, message content, thread content, batch |
strip_signature | true, false | true | Message content, thread content, batch clean JSON |
strip_quotes | true, false | true | Message content, thread content, batch clean JSON |
include_links | true, false | true | Message content, thread content, batch clean JSON |
include_html | true, false | false | Message content, thread content, batch clean JSON |
include_headers | none, selected, full | selected | Message content, thread content, batch clean JSON |
include_attachments | none, metadata | metadata | Message content, thread content, batch clean JSON |
cursor | Opaque cursor | none | Thread content |
limit | 1 to 100 | 25 | Thread content |
Body endpoints do not parse attachment contents. Attachments are returned as
metadata or downloaded separately. PDF, CSV, Office document, and OCR parsing
are not part of these APIs.
Attachments
UsePOST /mailbox/attachments:upload for binary files up to 7.5 MB. Send the
raw bytes in the request body, then pass the returned blob_id to
POST /mailbox/messages/send. Final outbound messages, including bodies,
headers, and encoded attachments, must fit inside the 25 MB raw message limit.
messages/send, but the
upload endpoint avoids large JSON request bodies.
Attachment downloads support byte ranges:
Sync APIs
Use sync endpoints to poll for changes with state tokens returned by earlier responses, or open an event stream when a client needs live updates.Event stream
GET /mailbox/events streams mailbox events as Server-Sent Events. Use it for
agents, CLIs, MCP servers, and SDKs that need to react when inbound mail arrives.
Use webhooks instead when a backend service should
receive signed event POSTs without keeping a live connection open.
id as the Last-Event-ID
header or the last_event_id query parameter. If the stream sends
sync_required, call GET /mailbox/changes before reopening the stream.
Optional query parameters:
| Parameter | Purpose |
|---|---|
event_types | Comma-separated list of message.received and message.received.spam. |
ping | Heartbeat interval in seconds, from 10 to 300. |
close_after | Close the stream after 30 to 3600 seconds. Omit for a long-lived stream. |
last_event_id | Replay events after a prior SSE event ID. |
Message query changes
GET /mailbox/messages/query-changes tracks how a filtered message list has
changed since a prior query_state. Omit since_query_state to get the
current query state for a filter without a change list.
Folder changes
GET /mailbox/folders/changes tracks folder object changes. Omit
since_state to get the current folder state without a change list.
Folder query changes
GET /mailbox/folders/query-changes tracks folder-list ordering changes. Omit
since_query_state to get the current folder query state.
Typed mailbox changes
GET /mailbox/changes keeps the legacy message-only response when types is
omitted. Pass a comma-separated types list to receive a typed state map.
types values are messages, folders, threads, submissions,
identities, and quotas.
Response format
The Mailbox API uses the same envelope as the Management API.Success
Error
X-Request-Id header matching meta.request_id. Include that value when contacting support.
Rate limiting
Mailbox API keys are rate-limited to 1800 requests per minute. Rate limit headers are included on responses:429 rate_limit_exceeded with a Retry-After header.
Conventions
- snake_case fields in JSON request and response bodies
- UTC ISO 8601 timestamps in RFC 3339 format:
2026-03-19T10:30:00Z - Opaque IDs only for mailbox, message, folder, and attachment resources
Cache-Control: no-storeon authenticated responses- Weak
ETagheaders on single-resource GETs where supported - Header-based idempotency for retriable POST requests where supported