Skip to main content

Basic batch send

curl -X POST https://api.torpedo.co.mz/api/v1/emails/batch \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "emails": [
      {
        "from": "Acme <hello@myapp.com>",
        "to": "alice@example.com",
        "subject": "Welcome to Acme",
        "html": "<h1>Welcome, Alice!</h1>"
      },
      {
        "from": "Acme <hello@myapp.com>",
        "to": "bob@example.com",
        "subject": "Welcome to Acme",
        "html": "<h1>Welcome, Bob!</h1>"
      }
    ]
  }'
Response:
{
  "data": [
    { "id": "01960000-0000-0000-0000-000000000001", "status": "queued" },
    { "id": "01960000-0000-0000-0000-000000000002", "status": "queued" }
  ]
}
The response array is in the same order as your input. The response is 202 Accepted.

Batch size limits

The maximum number of emails per batch request depends on your plan:
PlanMax per batch
Launch50
Starter100
Growth500
Scale1,000
Exceeding the limit returns 422:
{
  "errors": [{ "message": "Your plan allows a maximum of 100 emails per batch request" }]
}

All-or-nothing validation

The entire batch is validated before any email is queued. If any email fails a check, the whole request is rejected with 422 and nothing is sent. Checks that apply to every email in the batch:
  • from domain must be verified in your workspace
  • Each email must include html, text, or both
  • to must be a valid email address
  • Recipient must not be on the suppression list

Quota

Daily and monthly sending limits apply to the total number of emails in the batch. If the batch would push you over either limit, the entire request is rejected:
{
  "errors": [{ "message": "Daily email limit reached. Limit resets at midnight UTC." }]
}
Check current usage via GET /api/v1/workspace/usage.

Domain-scoped keys

If your API key is scoped to a specific domain, every email in the batch must use that domain as the sender. A mismatch returns 403.

Idempotency

Batch requests do not support the Idempotency-Key header. Use individual POST /api/v1/emails requests if you need idempotent sends.