Appearance
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
| Parameter | Type | Required | Description |
|---|---|---|---|
recipients | array | Yes | Array of recipient objects [{to, variables}]. Max 500 per request. |
from | string | No | Sender address. Must be a verified custom domain or omitted (defaults to hello@sendapi.co). |
from_name | string | No | Optional sender display name. |
subject | string | Yes | Email subject line. Supports template variables: . |
template_id | integer | No* | ID of a saved template. Use this OR html/text. |
html | string | No* | HTML body of the email. Supports substitution. |
text | string | No | Plain-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.