Skip to main content
The email goes out through the provider’s SMTP server (Gmail included), from the user’s own address, and lands in their Sent folder. The account goes in the path.
With curl, use --form-string for HTML bodies: -F 'html=<p>…' treats a value starting with < as a file name.

Fields

string
required
The account to send from (acc_…), in the path.
recipient[]
Recipients as [{ "email": "ana@example.com", "display_name": "Ana" }]. display_name is optional. At least one recipient is required (except for replies).
string
string
HTML body.
string
Plain-text body. Made from html when you leave it out.
object
{ "display_name", "email" }. display_name changes the sender’s name. email sends from an alias; the provider must allow it (a Gmail “Send mail as” address, for example). See Which addresses can send.
string
The email you answer: its Message-ID (from its headers), or its email_… id. See Replies and threads.
recipient[]
Addresses for the Reply-To header. This is not the email you answer.
object[]
[{ "name": "X-Campaign", "value": "q4" }]. Allowed: any X-… header, List-Unsubscribe, List-Unsubscribe-Post, Auto-Submitted, and Reply-To. Content-Type is accepted and ignored. Auto-Submitted marks an automatic email (RFC 3834): auto-replied for an auto-reply, auto-generated for other automatic mail; other values are refused. Mail servers and auto-responders don’t answer such mail, so two auto-responders can’t email each other forever.
object
{ "opens": true, "links": true, "label": "…" }. See Tracking.
string
Your own note about this email, up to 1000 characters, for example which user or rule sent it. It’s never put in the email. It comes back on the email’s Sent copy as sent_by.metadata (in email.new), so you can tell your own sends apart, like Messenger’s echo metadata.
file[] | object[]
Multipart: files in fields named attachments. JSON: [{ "filename", "content_type", "content" }] with content in base64.
In a multipart request, write recipients as to[0][email], to[0][display_name], to[1][email] and so on (the same for cc, bcc and reply_to). Send tracking_options and custom_headers as JSON text. Requests are limited to 30 MB in total, attachments included. Providers have their own limits, for example 25 MB for Gmail.

Which addresses can send

GET /api/v1/{account_id}/email-senders lists the addresses you can put in from. For an IMAP account that’s its own address: the one it connected with.
Response
display_name is there when the account has a name. verification_status is verified, pending or unknown; an IMAP account’s own address is always verified.

Response

201 Created
  • message_id identifies the email in every mailbox it reaches. Its Sent copy has the same Message-ID header.
  • provider_id is null: SMTP doesn’t return an id when sending. The Sent copy gets its email_… id when it syncs.
  • tracking_id is a trk_… id when you use tracking_options, otherwise null.
  • The Sent copy syncs a moment later, and you receive an email.new event with the full email, origin: "api", is_echo: false and sent_by (the API key it was sent with and your metadata).
There’s no forward call. To forward, send a new email with the original’s content and files. See Replies and threads.
If a send request times out on your side, don’t retry blindly: the email may already be on its way. First check the Sent folder (GET /api/v1/acc_…/folders/fld_…/emails, with the id of the folder whose role is SENT) for an email whose Message-ID header matches.