Skip to Content
SendlySendly
API ReferenceEmails

Send a batch of emails

POST
/api/emails/batch

Send up to 100 emails in one request. Returns 207 Multi-Status if any entry failed, or 200 if all succeeded. Per-entry results are reported in the data array. An entry with a recipient at a reserved domain (.test, .example, .invalid, .localhost, .local, example.com and the like, which can never receive mail) fails alone with RESERVED_RECIPIENT_DOMAIN; the other entries are still sent.

The whole batch is ONE idempotent unit: an Idempotency-Key replayed with the same entry list replays the same per-index results, and replaying it with an edited list answers 422 IDEMPOTENCY_KEY_REUSED rather than returning results for indexes the new body no longer has.

The request body may be at most 33554432 bytes (32 MiB). A larger one answers 413 PAYLOAD_TOO_LARGE before anything is parsed or sent; split it across requests. Attachments are the usual reason a batch gets that big, since each entry may carry up to 10 MB of them, base64-encoded.

Requires the emails:send scope — Send emails from your verified domains.

headerAuthorizationBearer <API Key>

API key authentication. Use a sk_* (FULL) or pk_* (SENDING_ONLY) key as the bearer token. Public keys (pk_*) are restricted to the email-send endpoints and the self-serve list subscribe/unsubscribe pair; every other endpoint — event tracking included — answers 403 for them. In scope terms (used by /api/v1/* operations): FULL keys hold every scope; SENDING_ONLY keys hold only emails:send.

Idempotency-Key?string
Length1 <= length <= 255
application/json
  1. body

Batch send wrapper. Up to 100 entries.

emails*array<>
Items1 <= items <= 100

Response Body

All entries sent

application/json
  1. response

Multi-status response for POST /api/emails/batch. HTTP 207 if any entry failed, else 200.

success*boolean
data*array<>
Example Request
curl -X POST 'https://api.sendly.now/api/emails/batch' \  -H 'Content-Type: application/json' \  -d '{  "emails": [    {      "to": "user@example.com"    }  ]}'
Example Response
{  "success": true,  "data": [    {      "index": 0,      "status": "ok",      "data": {        "emails": [          {            "contact": {              "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",              "email": "user@example.com"            },            "email": "bd2f409a-4b68-41eb-89af-5a917d812282"          }        ],        "timestamp": "2019-08-24T14:15:22Z"      },      "error": {        "message": "string",        "code": "string"      }    }  ]}