Skip to main content

Overview

These actions manage a connected email mailbox. They run on the same POST /v2/messages endpoint (except attachment download, a GET). Each action costs 1 credit. Availability: all actions work on Gmail, Outlook and IMAP/SMTP mailboxes. Outlook’s write actions (mark_as_read/mark_as_unread, archive, trash, create_draft) require a mailbox connected with the Mail.ReadWrite scope — reconnect mailboxes added earlier. On IMAP, archive/trash move the message to the mailbox’s Archive/Trash folder (best-effort per server). The id used below is the provider message id returned by List Inbox (conversations[].id) and Get Conversation (messages[].id).

Read state, archive, trash

string
required
The email account.
string
required
One of mark_as_read, mark_as_unread, archive, trash.
object
required
Request
200

List labels

action: "list_labels" returns the mailbox’s folders/labels (id, name, type) — use a label id in list_inbox’s label_ids to read another folder.
200

Create a draft

action: "create_draft" saves a draft (not sent). Same body params as Send (to, subject, message_text / html, plus attachments via media_*).
Request
200

Download attachment

GET /v2/messages/attachment streams an attachment’s bytes. For email, pass the message_id and attachment_id from a message’s attachments[] (via Get Conversation), plus an optional filename. Gmail and Outlook. Costs 1 credit.
string
required
The email account.
string
required
The provider message id carrying the attachment (attachments[].message_id).
string
required
The attachment id (attachments[].attachment_id).
string
Optional filename for the download.
Returns the raw file with its Content-Type, or the standard JSON error envelope.