# Messages

The store: list/read (parsed content, raw MIME, individual parts), flags/labels/keywords updates, batch operations, trash and restore, incremental sync (/changes), spam-filter training, and the live WebSocket event feed.

- `GET` [List mailbox messages](/docs/api/messages/get_MessageList): Lists messages newest-first (or oldest-first with order=asc) with cursor pagination, optionally filtered to one label. sortBy=date orders by the Date header…
- `PATCH` [Update flags and labels for multiple messages or whole conversations](/docs/api/messages/patch_MessageBatchUpdate): Applies flag, label, and keyword updates across multiple messages in a single atomic operation.
- `POST` [Append raw MIME message to mailbox](/docs/api/messages/post_MessageAppend): Stores raw RFC 5322 email bytes directly into a mailbox under a label without sending (similar to IMAP APPEND).
- `DELETE` [Empty trash, or delete a batch of messages or whole conversations](/docs/api/messages/delete_MessageEmptyTrash): Permanently purges every row on the Recently-deleted tier with state=expunged, or deletes the messages named by ids and/or the conversations named by threadIds.
- `GET` [Get message metadata](/docs/api/messages/get_MessageGet): Returns metadata for a specific message including subject, sender/recipients, labels, flags, UIDs, and timestamps.
- `PATCH` [Update message flags and labels](/docs/api/messages/patch_MessageUpdate): Updates message flags, adds or removes labels, and modifies custom keywords.
- `DELETE` [Delete a message](/docs/api/messages/delete_MessageDelete): Soft-deletes a message to trash or permanently purges it.
- `GET` [Get parsed message content and attachments](/docs/api/messages/get_MessageGetContent): Returns decoded email headers, inline plain text and HTML bodies, and attachment metadata for a message.
- `GET` [Get raw MIME message body](/docs/api/messages/get_MessageGetRaw): Streams the full raw RFC 5322 MIME message bytes directly from storage.
- `GET` [Get specific message MIME part](/docs/api/messages/get_MessageGetPart): Streams a single decoded MIME part or raw encoded slice from message storage by section number.
- `POST` [Batch get message metadata](/docs/api/messages/post_MessageBatchGet): Retrieves metadata summaries for up to 200 messages in a single request.
- `POST` [Batch get raw header blocks](/docs/api/messages/post_MessageHeadBatch): Returns each message's raw header block (base64, byte-exact, separator line included) from one bounded head read per message — the projection an IMAP folder…
- `POST` [Batch get cached MIME structures](/docs/api/messages/post_MessageMimeBatch): Returns cached MIME envelope and body structure metadata for multiple messages without downloading raw blobs.
- `GET` [List the keywords in use, with counts](/docs/api/messages/get_MailboxKeywordList): Every distinct keyword on this mailbox's LIVE messages, most-used first then alphabetical, with how many messages carry each.
- `GET` [Full-text search a mailbox](/docs/api/messages/get_MailboxSearch): Searches email messages across subject, sender/recipient addresses, and body text using BM25 relevance ranking.
- `POST` [Structured filter and query messages](/docs/api/messages/post_MailboxSearchQuery): Executes a structured query over mailbox messages with complex filters (combinators, header conditions, date ranges, flag states) and custom sort orders.
- `PATCH` [Update flags, labels and keywords for every message a search selects](/docs/api/messages/patch_MailboxSearchQueryUpdate): Applies one patch to every message POST /search/query would return for the same filter — the way to act on a whole result set without naming its messages.
- `POST` [Highlighted excerpts for search results](/docs/api/messages/post_MailboxSearchSnippets): Builds the same highlighted <mark> excerpts (subject + body preview) the search surfaces return inline under snippet, for up to 50 result ids the caller…
- `GET` [Semantic (meaning-based) search of a mailbox](/docs/api/messages/get_MailboxSemanticSearch): Finds the messages whose MEANING is closest to the query, ranked by similarity — 'the invoice from the Berlin supplier' finds it whether or not those words…
- `GET` [Messages similar to one message](/docs/api/messages/get_MessageSimilar): 'More like this': the message's own embedding is the query.
- `GET` [Get message sync changes](/docs/api/messages/get_MessageChanges): Answers created / updated / destroyed message ids for everything that happened since since, plus a newState to send next time.
- `GET` [Subscribe to live mailbox change events over WebSocket](/docs/api/messages/get_MailboxEvents): Upgrades to a WebSocket that streams best-effort change signals for this mailbox: message.new (delivery), message.updated / message.expunged / message.restored…
- `POST` [Save structured message to mailbox](/docs/api/messages/post_MessageCompose): Constructs and saves an email message from structured JSON (headers, body text/HTML, attachments) into a mailbox without sending.
- `POST` [Copy or move messages and conversations into another mailbox](/docs/api/messages/post_MessageCopy): Stores each message again, from its original bytes, in a folder of another mailbox you can reach, with its flags, keywords and received time.
- `POST` [Train spam filter from a message](/docs/api/messages/post_MessageLearn): Submits spam or ham training feedback for a specific email message to tune the spam filter.
- `POST` [Train spam filter from multiple messages](/docs/api/messages/post_MessageBatchLearn): Submits spam or ham training feedback for a batch of messages in a single request.
- `POST` [Take messages out of Trash, back to where they were filed](/docs/api/messages/post_MessageBatchUntrash): Removes the Trash label from a batch of messages.
- `POST` [Take messages out of Junk, back to where they were filed](/docs/api/messages/post_MessageBatchUnjunk): Removes the Junk label from a batch of messages — the "Not spam" verb, and POST /messages/untrash's counterpart for the other state label.
- `POST` [Restore an expunged message from trash](/docs/api/messages/post_MessageRestore): Restores one message from the Recently-deleted tier back to where it was filed (restoresTo), or Inbox when that is no longer resolvable.
- `POST` [Restore multiple messages from trash](/docs/api/messages/post_MessageBatchRestore): Restores a batch of messages from the Recently-deleted tier in a single atomic operation, each back to where it was filed (restoresTo).
