Skip to main content
Queue up to 100 emails in one request. Each item is an independent send — the batch returns a result per item, in order, so a single bad recipient never fails the rest. POST /v1/emails/batch The body is an emails array, where each element is exactly the same shape as a single POST /v1/emails body. Counts as one request against your rate limit.

Body parameters

emails
object[]
required
Between 1 and 100 send objects. Each item accepts the full send-email bodyfrom, to, subject, html/text or templateId + data, attachments, tags, and so on.

Headers

X-Drin-Product
header
Names the sending project for account-wide keys (alias: X-Drin-Sender). Project-scoped keys may omit it.

Request

curl https://api.drin.run/v1/emails/batch \
  -H "Authorization: Bearer $DRIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "emails": [
      {
        "from": { "email": "hello@yourdomain.com" },
        "to": [{ "email": "a@example.com" }],
        "subject": "Receipt #1",
        "html": "<p>Thanks!</p>"
      },
      {
        "from": { "email": "hello@yourdomain.com" },
        "to": [{ "email": "b@example.com" }],
        "subject": "Receipt #2",
        "html": "<p>Thanks!</p>"
      }
    ]
  }'

Response

207 Multi-Status — a data array aligned to your input order. Each element either carries an id (the message was queued) or an error with the usual { type, message, param? } envelope. Always inspect every element; a 207 does not mean every send succeeded.
207 Multi-Status
{
  "data": [
    { "id": "msg_01HZX9K3T2QF7P0M4N8B6C5D" },
    {
      "error": {
        "type": "suppressed",
        "message": "Recipient is on the suppression list.",
        "param": "to"
      }
    }
  ]
}
Per-item, not all-or-nothing. The batch isn’t transactional. Items that validate are queued even when siblings fail. Match results to inputs by array index, and retry only the failed items.
One template, many recipients. To send the same template to many people, set the same templateId on each item and vary to and data. See Batch & scheduled.