Runs examples for real against your account. Test keys only; kept in this tab, never stored on our side. Get a key
ZapSMTP / Docs / Emails

Send a batch

POST/v1/emails/batch

Send 1-100 emails in one request.

Requires a full-access or sending-access key. Test keys follow the same rules as for sending.

Per-email error codes use the same classification as POST /emails (domain_not_verified, restricted_api_key, rate_limit_exceeded, monthly_quota_exceeded, etc. appear inside errors[] rather than as the HTTP status). Emails are sent concurrently (up to 16 at a time); each email may have its own scheduled_at.

Body: length 1-100 else 422 invalid_parameter "batch must contain 1 to 100 emails"

An item of data carries reply_to when reply tracking is on for that email.

Headers

x-batch-validationstring
strict (default) | permissive (case-insensitive). strict: if any email fails validation nothing is sent and 422 is returned. permissive: valid emails are sent; invalid ones are reported in errors.
Idempotency-Keystring
optional, 1-256 bytes

Body parameters

[ ]object[]required
1–100 emails. Each item takes the fields of Send an email.

Errors

validation_errorHTTP 400
invalid JSON or x-batch-validation not strict/permissive
invalid_idempotency_keyHTTP 400
Idempotency-Key must be 1 to 256 bytes
idempotency_key_reusedHTTP 409
idempotency_request_in_progressHTTP 409
payload_too_largeHTTP 413
invalid_parameterHTTP 422
batch size outside 1-100
validation_errorHTTP 422
strict mode, any email invalid
service_unavailableHTTP 503
too many large bodies in flight
POST/v1/emails/batch
curl -X POST 'https://zapsmtp.xyz/v1/emails/batch' \
  -H "Authorization: Bearer $ZAP_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '[
  {
    "from": "Acme <hello@acme.com>",
    "to": [
      "delivered@simulator.zapsmtp.xyz"
    ],
    "subject": "Hello Ann",
    "text": "Hi Ann!"
  },
  {
    "from": "Acme <hello@acme.com>",
    "to": [
      "bounced@simulator.zapsmtp.xyz"
    ],
    "subject": "Hello Bob",
    "text": "Hi Bob!"
  }
]'
Set ZAP_API_KEY in your environment.
Response 200 OK
{
  "data": [
    {
      "index": 0,
      "id": "019a1f2e-7c3b-7d41-9a52-0c4b8e6f1a23"
    },
    {
      "index": 2,
      "id": "019a1f2e-7c3c-7a10-8b21-4d5e6f7a8b9c",
      "suppressed": [
        "old@example.org"
      ]
    }
  ],
  "errors": [
    {
      "index": 1,
      "code": "missing_required_field",
      "message": "subject is required"
    }
  ]
}