Send a batch of emails

Accept a JSON array of 1–100 email objects, each identical to the single send body.

POSThttps://api.mailfully.com/v1/emails/batch

Accept a JSON array of 1–100 email objects, each identical to the single send body. The batch is all-or-nothing: every object is validated and prepared before any write, so the first invalid object aborts the whole batch with a single 422 whose param names the offending index (for example [37].to), and a quota/spend/daily-cap denial rejects the entire batch — nothing is persisted or enqueued, though a daily-cap denial part-way through has already consumed daily-cap allowance for the units checked before it. On success returns 202 with one accepted id per input object, in request order. Requires the send scope. Honors the optional Idempotency-Key header.

Loading code example
Loading code example

Authorizations

Authorizationstringheaderrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Header Parameters

Idempotency-Keystring

Opt-in idempotency key, 1–256 characters (no charset restriction). A repeated key with the same body within 24 hours replays the original `2xx` response verbatim; the same key with a different body returns `409`.

Length: >= 1, <= 256

Body

Response

application/json

All emails in the batch were accepted.

dataarray<object>required

One accepted id per input object, in request order.

data.idstringrequired

The accepted message id (a bare ULID, no prefix).