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.
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.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.