POST/emails

Send an email

Sends an email to one or more recipients. Supply from, to, and subject; use either message content in html or text, or a published template. A successful response includes the sent email's identifier.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 14 body fields
Idempotency-Keystringoptional
A unique key that prevents the same request from sending emails more than once. Maximum 256 characters.

Email message and delivery settings. Supply from, to, and subject; use message content or a published template.

fromstringrequired
Sender email address. To include a friendly name, use the format "Your Name <sender@domain.com>".
tostringrequired
Recipient email address. For multiple addresses, send as an array of strings. Max 50.
subjectstringrequired
Email subject.
bccstringoptional
Bcc recipient email address. For multiple addresses, send as an array of strings.
ccstringoptional
Cc recipient email address. For multiple addresses, send as an array of strings.
reply_tostringoptional
Reply-to email address. For multiple addresses, send as an array of strings.
htmlstringoptional
The HTML version of the message.
textstringoptional
The plain text version of the message.
templateobjectoptional
Published template configuration with a required `id` and optional `variables`. Do not include `html` or `text` when using a template.
headersobjectoptional
Custom headers to add to the email.
scheduled_atstringoptional
Schedule email to be sent later. The date should be in ISO 8601 format.
attachmentsarray<object>optional
Files to attach, specified by their content or hosted path and optional filename, content type, and content ID.
tagsarray<object>optional
Email tags with a name and value; each can contain only ASCII letters, numbers, underscores, or dashes and must not exceed 256 characters.
topic_idstringoptional
The topic ID to scope the email to. If the recipient is a contact and opted-in to the topic, the email is sent. If opted-out, the email is not sent. If the recipient is not a contact, the email is sent if the topic's default subscription is opt_in.

1 status code
200Returns an object containing the ID of the sent email.
idstringoptional
The ID of the sent email.

Error handling

from, to, and subject are required, and to accepts an email address or an array of up to 50 addresses. If you provide template, include its id and omit html and text; scheduled_at must use ISO 8601 format. The optional Idempotency-Key header must not exceed 256 characters.