Batch sending
Queue up to 100 emails in one call, all or nothing.
One call, up to 100 emails
POST /v1/emails/batch takes an array of 1 to 100 emails, each with the same fields as a single send. The answer (202) lists an id and status per email in request order.
curl https://api.letr.dev/v1/emails/batch \
-H "Authorization: Bearer $LETR_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{"from": "Acme <[email protected]>", "to": "[email protected]", "subject": "Receipt 1042", "text": "Thanks."},
{"from": "Acme <[email protected]>", "to": "[email protected]", "subject": "Receipt 1043", "text": "Thanks."}
]'
{ "data": [{ "id": "...", "status": "queued" }, { "id": "...", "status": "queued" }] }
All or nothing
letr.dev validates every email, counts the whole batch against your limits and stores it in one transaction. If one email fails, none is queued. The error message names the position, for example [3].to for the fourth email. A batch that would pass your monthly ceiling or the daily limit answers 429; an empty array or more than 100 answers 422 invalid_batch.
Retries
One Idempotency-Key covers the whole batch: a repeat with the same key and body returns the ids and current status of the first batch and sends nothing, see retries without duplicates.