Folders are named by role, not by path. Use
inbox, archive, sent,
drafts, junk or trash.Path names are not portable and are not even stable for us — Junk is “Junk” on
Dovecot and “Spam” elsewhere, Trash is “Deleted Items” on Exchange, and any of
them can sit under a namespace prefix. Roles are resolved against the server’s
own SPECIAL-USE attributes on every request, so folder=junk keeps meaning the
junk folder whatever it is called.Folders you made are addressed by their path from
GET /v1/folders. move_to accepts either, so a
message can be filed into one; folder= on the read endpoints takes a role.List messages
messages:read)
total is how many messages the folder holds, not how many came back, so
you can tell whether another page exists without fetching it. has_more says
the same thing directly.
Bodies are not included in the list — a page of 100 messages with full HTML
would be megabytes. Use preview, or fetch the message.
Get one message
messages:read)
Takes the same mailbox (required) and folder parameters as the list.
html is sanitised before it reaches you. The stored bytes are whatever a
stranger sent us; scripts, event handlers and other active content are removed.
text is the message’s own plain-text part, untouched.html is null for a plain-text message, so you can tell “no HTML” from
“empty HTML”.Update a message
messages:write)
Takes mailbox (required) and folder as query parameters — naming where the
message is now — and the change as a JSON body. Send at least one of:
add_labels and remove_labels take keywords, not names, and every one
must belong to your organization — read them from
GET /v1/labels. An unknown keyword is refused
before anything is written, so a request naming one bad label does not
half-apply.A label’s keyword never changes, even when the label is renamed, so it is the
safe thing to store in your own code.Change many messages at once
messages:write)
The same change, applied to up to 500 messages in one request.
Use this rather than looping. Archiving five hundred messages one request at
a time is five hundred round trips against a 600/minute ceiling, and five
hundred IMAP sessions on the mail server, to do what the web app does in one
click. This is the same work in one request.Pair it with
GET /v1/threads, whose uids array is exactly
what this endpoint wants — archiving a whole conversation is one list handed
straight over.Errors
See Errors for the full response shape.