Skip to content

Bulk Email

POST /v1/email/send-bulk

Send an email to multiple recipients in a single API call. Each recipient can receive personalized content via per-recipient variable substitution. Bulk sends are queued and processed asynchronously.

Request Body

ParameterTypeRequiredDescription
recipientsarrayYesArray of recipient objects [{to, variables}]. Max 500 per request.
fromstringNoSender address. Must be a verified custom domain or omitted (defaults to hello@sendapi.co).
from_namestringNoOptional sender display name.
subjectstringYesEmail subject line. Supports template variables: .
template_idintegerNo*ID of a saved template. Use this OR html/text.
htmlstringNo*HTML body of the email. Supports substitution.
textstringNoPlain-text fallback body.
bash
curl -X POST https://sendapi.co/v1/email/send-bulk \
  -H "Authorization: Bearer sk_live_123456789" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "updates@myapp.com",
    "subject": "Hello {{name}}, your report is ready",
    "recipients": [
      { "to": "alice@example.com", "variables": { "name": "Alice" } },
      { "to": "bob@example.com", "variables": { "name": "Bob" } }
    ],
    "html": "<h1>Hi {{name}}!</h1><p>Your weekly report is ready to view.</p>"
  }'
javascript
const batch = await client.email.sendBulk({
  from: 'updates@myapp.com',
  subject: 'Hello {{name}}, your report is ready',
  recipients: [
    { to: 'alice@example.com', variables: { name: 'Alice' } },
    { to: 'bob@example.com', variables: { name: 'Bob' } }
  ],
  html: '<h1>Hi {{name}}!</h1><p>Your weekly report is ready.</p>'
});

Response

HTTP 202 Accepted:

json
{
  "success": true,
  "data": {
    "batch_id": "email_batch_KqXJj9aWbR2c",
    "total_recipients": 2,
    "status": "queued",
    "message": "Bulk email send queued for processing"
  }
}

Unsubscribe Headers

Bulk email sends automatically include List-Unsubscribe headers to comply with Gmail and Yahoo bulk sender requirements.

Released under the MIT License.