Send Batch Emails
Send up to 100 emails in a single API call. Attachments and scheduled_at are not supported in batch mode.
/emails/batchResend Compatibility: Compatible
Body Parameters
The request body is an array of email objects (max 100).
fromstringrequiredSender email address. To include a friendly name, use the format "Your Name <sender@domain.com>".
tostring | string[]requiredRecipient email address. For multiple addresses, send as an array of strings. Max 50.
subjectstringrequiredEmail subject.
htmlstringThe HTML version of the message.
textstringThe plain text version of the message.
bccstring | string[]BCC recipient email address(es).
ccstring | string[]CC recipient email address(es).
reply_tostring | string[]Reply-to email address(es).
headersobjectCustom headers to add to the email.
tagsarrayCustom data passed in key/value pairs.
namestringrequiredThe name of the email tag. Max 256 characters.
valuestringrequiredThe value of the email tag. Max 256 characters.
Headers
Idempotency-KeystringheaderAdd an idempotency key to prevent duplicated batch sends. Max 256 characters. Expires after 24 hours.
Response Fields
dataarrayArray of objects containing the id of each created email. Failed emails have an empty id and an error field.
curl -X POST 'https://api.postflare.app/emails/batch' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '[
{
"from": "Acme <hello@acme.com>",
"to": ["user1@example.com"],
"subject": "Hello User 1",
"html": "<p>Hello User 1!</p>"
},
{
"from": "Acme <hello@acme.com>",
"to": ["user2@example.com"],
"subject": "Hello User 2",
"html": "<p>Hello User 2!</p>"
}
]'import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.batch.send([
{
from: 'Acme <hello@acme.com>',
to: ['user1@example.com'],
subject: 'Hello User 1',
html: '<p>Hello User 1!</p>',
},
{
from: 'Acme <hello@acme.com>',
to: ['user2@example.com'],
subject: 'Hello User 2',
html: '<p>Hello User 2!</p>',
},
]);Response
{
"data": [
{ "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794" },
{ "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012" }
]
}