Send Batch Emails

Send up to 100 emails in a single API call. Attachments and scheduled_at are not supported in batch mode.

POST/emails/batch

Resend Compatibility: Compatible

Body Parameters

The request body is an array of email objects (max 100).

fromstringrequired

Sender email address. To include a friendly name, use the format "Your Name <sender@domain.com>".

tostring | string[]required

Recipient email address. For multiple addresses, send as an array of strings. Max 50.

subjectstringrequired

Email subject.

htmlstring

The HTML version of the message.

textstring

The 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).

headersobject

Custom headers to add to the email.

tagsarray

Custom data passed in key/value pairs.

namestringrequired

The name of the email tag. Max 256 characters.

valuestringrequired

The value of the email tag. Max 256 characters.

Headers

Idempotency-Keystringheader

Add an idempotency key to prevent duplicated batch sends. Max 256 characters. Expires after 24 hours.

Response Fields

dataarray

Array 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

Response
{
  "data": [
    { "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794" },
    { "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012" }
  ]
}