Sign inGet Started

Batch sending

POST /v1/email/batches accepts up to 100 complete message payloads in one request for bulk email delivery of independent messages. Each item specifies a sender, recipients, and content. Use a batch to submit receipts, alerts, or other per-recipient messages with fewer API requests. For a single message, see Sending email.

When to use what

  • Independent messages you already have ready. Send them in one batch request.
  • A steady high-volume stream. Calling the single-send endpoint in a loop works well. Batching does not make individual messages cheaper or faster to deliver. It increases throughput because batch requests use the email_batch rate-limit policy instead of email_send. Each batch request accepts up to 100 messages.
  • One email to a stored audience. That is a broadcast, which resolves the audience into recipients and personalizes per contact.

Templates in a batch

Each item can use a published template with separate parameters and language values.

A template that references contact attributes personalizes each To address from contacts in the same workspace. Cc and Bcc recipients receive a copy of each To recipient's personalized email and do not need a matching contact. The batch shares lookups for repeated addresses and reads the attributes each template uses. A selected language and request envelope without contact references do not trigger a contact lookup.

Recipient values are saved when the batch is accepted, including scheduled items. Editing a contact or fallback later does not change a queued message. A missing To contact, missing required parameter, ambiguous contact match, or invalid contact value rejects the batch before any item is admitted. A database failure returns a retryable error instead of treating the contact as missing. See template personalization for missing-value and fallback rules.

Batch sends

The request body is a JSON object whose messages array holds 1 to 100 message objects. Each item is a complete, independent message request with from, to, subject, content, and optional category, ip_pool_id, tags, and metadata. The item schema matches the single-message payload. Every rule in sending email applies per item, including the marketing default for category and sending with a template.

Each item can also include scheduled_at. A single batch can mix immediate messages and scheduled messages with different delivery times. The rules and allowance in scheduled sending apply per item. Cancel a scheduled item by its message ID like any other scheduled message.

const batch = await bird.email.sendBatch({
  messages: [
    {
      from: { email: "onboarding@messagebird.dev", name: "Bird" },
      to: ["alice@example.com"],
      subject: "Your receipt",
      html: "<p>Thanks, Alice.</p>",
    },
    {
      from: { email: "onboarding@messagebird.dev", name: "Bird" },
      to: ["bob@example.com"],
      subject: "Your receipt",
      html: "<p>Thanks, Bob.</p>",
    },
  ],
});
for (const item of batch.data) console.log(item.id, item.status);

All-or-nothing validation

Every item is validated before any item is queued. If one message fails (for example, with a field-level validation error or an unverified sender domain), the entire batch is rejected with a 422 and nothing is sent. Fix the failing item and resubmit the batch.

Suppression is not part of request validation. An item whose recipients are all suppressed is still accepted and receives an em_ ID. Those recipients return status: rejected once the message is processed (see suppressions).

Handle the 202 response

A successful batch returns 202 Accepted with one entry per message, in submission order:

Code example
{
  "data": [
    { "id": "em_01ky7q1vmkerwa7fxyycfe5ks1", "status": "accepted", "category": "transactional" },
    { "id": "em_01ky7q1vmkesr9h1y52tkqng9f", "status": "accepted", "category": "marketing" },
    { "id": "em_01ky7q1vmkesyr1z1h4s48jjxm", "status": "accepted", "category": "transactional" }
  ]
}

Each item becomes an ordinary message. Track it by its em_ ID through GET /v1/email/messages/{message_id}, the recipient and event endpoints, and webhooks, as if you had sent it individually. The same async model applies. A 202 response confirms durable acceptance. Per-recipient outcomes arrive afterward.

Idempotent retries

Idempotency is optional. The SDKs generate a key for automatic retries. For retries across separate calls or when using HTTP directly, see the idempotency guide for key reuse and replay limits.

Attachments and the body cap

Each batch item can include attachments using the same field contract and per-message size budget as a single message (see attachments). The serialized JSON request body for the entire batch is also capped at 20 MB. Larger bodies are rejected with a 413. Base64-encoded attachments count against this limit. Attachment-heavy batches reach the cap quickly. Split them across several batches or send them one at a time.

Broadcasts

A broadcast sends one email to a stored audience. When the broadcast starts, we resolve the audience's current members (minus suppressions) into the recipient list. Each recipient's contact properties fill the template's variables. Run broadcasts from the dashboard, through /v1/email/broadcasts, or with the bird email broadcasts commands. See Broadcasts for a walkthrough.

Next steps

  • Sending email: the per-item payload in full, including fields, limits, and tags vs metadata
  • Broadcasts: one email to a stored audience, personalized per contact
  • Categories: marketing and transactional, and what each does to suppression policy
  • Idempotency: key format, retention, and replay semantics
  • API reference: the full batch request and response schemas
  • Send 100 emails in one API call: a video that shows a batch going out and how each message reports back

Continue with the documentation, guides and examples for this topic.