FlaresendDocs
Emails

Send a batch

Queue up to 100 emails in one request, with a result for each.

POST/v1/emails/batchAPI key

The body is a JSON array of emails. Each item is checked and queued on its own, exactly like Send an email, so one bad item doesn't stop the others. The response lists one result per item, in the same order as the request.

Add ?dryRun=true to validate every item and see what would be sent, without sending anything.

Query parameters

dryRunbooleanquerydefault: false

true or 1 to validate only. Each item is checked (sender, recipients, suppressions, headers, template, attachments, size) and nothing is stored, queued or counted against limits.

Headers

Idempotency-Keystringheader

One key for the whole batch. Flaresend stores it per item as <key>:<index>, so item 0 of batch key import-7 gets import-7:0. An item with its own idempotencyKey keeps its own key instead. Resending the same batch with the same key returns the original emails with idempotent: true and sends nothing again. See Idempotency.

Body

An array of 1 to 100 email objects. Each object takes the same fields as the body of Send an email: from, to, cc, bcc, replyTo, subject, html, text, template, data, headers, tags, attachments, scheduledAt, trackOpens, trackClicks and idempotencyKey.

Response

Status 200, whatever happened to the individual items. Check each item.

dataArray<Result | { error }>

One entry per request item, in the same order.

Show result properties
idstring

The email ID.

status'queued' | 'scheduled' | 'test'

The same values as a single send.

idempotentboolean

true when the item replayed an earlier send with the same key.

errorobject

Present instead of id and status when the item failed: { type, code, message, param? }, the same shape as any error.

Dry run response

With ?dryRun=true the body is { "dryRun": true, "data": [...] }, and each item is either { "ok": true, from, to, cc, bcc, subject } with the resolved sender, the deduplicated recipient lists and the final subject (after rendering the template), or { "error": … }. A dry run does not check idempotency keys or rate limits.

Errors

These fail the whole request. Errors for single items come back inside data.

StatusCodeWhen
400missing_bodyNo body.
400invalid_bodyThe body isn't a JSON array, is empty, or has more than 100 items.