eusend
Emails

Batch Send

Send up to 100 emails in a single request. Each email is independent — failures are per-email.

POST/emails/batch

Request body

An array of up to 100 email objects. Each object has the same schema as POST /emails, except that attachments and scheduled_at are not supported here — send or schedule those individually via POST /emails.

request
curl -X POST https://api.eusend.dev/emails/batch \
  -H "Authorization: Bearer eu_live_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "from": "noreply@acme.com",
      "to": "alice@example.com",
      "subject": "Receipt #1001",
      "html": "<p>Thanks, Alice!</p>",
      "tags": { "category": "receipt" }
    },
    {
      "from": "noreply@acme.com",
      "to": "bob@example.com",
      "subject": "Receipt #1002",
      "html": "<p>Thanks, Bob!</p>"
    }
  ]'

Response

One result per input email, in the same order: data[i] describes emails[i]. A queued email carries its id; an email that could not be queued carries error and code instead (for example an unverified sender domain, all recipients suppressed, or an exhausted quota). Failed items never fail the rest of the batch — retry just those.

response — 201 Created
{
  "data": [
    { "id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d" },
    { "error": "All recipients are suppressed", "code": "ALL_SUPPRESSED" }
  ]
}
⚠

Batch sends count toward your daily and monthly limits. A batch of 50 emails uses 50 of your quota.

Idempotency

Pass an Idempotency-Key header to make a retried batch safe. Each item is tracked under the key and its position, so resending the same batch returns the ids of the emails that were already queued — without sending them again — and processes only the items that failed or never ran. Keep the items in the same order when you retry. A batch whose items were all queued before answers 200 OK with the original ids.

Keys must be at most 255 characters and contain no control characters; invalid keys return 400 VALIDATION_ERROR. Batch keys are separate from single-send keys, and test and live sends use separate key spaces.

Retries matching older batch keys can return 409 CONFLICT because the old keys cannot always be distinguished from single-send keys. No items are queued when this happens. Check the original emails' statuses before deciding whether to use a new key, since a new key may send duplicate emails.