POST
/emails/batchSend a batch of emails
Submits a batch of email messages for sending, with up to 100 emails in the batch. Each message requires from, to, and subject; the response includes an ID for each submitted email.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Idempotency-Keystringoptional
A unique key that prevents the same request from sending emails more than once. Maximum 256 characters.
An array of email messages to send. Each message requires from, to, and subject.
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
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
tagsarray<object>optional
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.
200Returns an object containing an array of IDs for the emails in the batch.
dataarray<object>optional
Error handling
Each email in the batch must include from, to, and subject; to accepts an email address or an array of up to 50 addresses. If an email uses 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.