Batch Sending
Send up to 500 emails in a single API call. Supports both template-based sending with per-recipient variables, and direct mode with individual email content.
POST/api/send/batch
Two Sending Modes
The batch endpoint supports two mutually exclusive modes:
Template Mode
Provide templateId + recipients array. Each recipient can have unique variables.
Direct Mode
Provide an emails array where each item has its own subject and content.
Template Mode
| Parameter | Type | Required | Description |
|---|---|---|---|
| templateId | string | Required | ID of the template to use |
| recipients | array | Required | Array of recipient objects (max 500) |
| recipients[].to | string | Required | Recipient email address |
| recipients[].variables | object | Optional | Template variables for this recipient |
Template mode request
curl -X POST https://fwd.sarthak.online/api/send/batch \
-H "x-api-key: fwd_your_key" \
-H "Content-Type: application/json" \
-d '{
"templateId": "tmpl_abc123",
"recipients": [
{
"to": "alice@example.com",
"variables": { "name": "Alice", "plan": "Pro" }
},
{
"to": "bob@example.com",
"variables": { "name": "Bob", "plan": "Free" }
}
]
}'Direct Mode
| Parameter | Type | Required | Description |
|---|---|---|---|
| emails | array | Required | Array of email objects (max 500) |
| emails[].to | string | Required | Recipient email address |
| emails[].subject | string | Required | Email subject line |
| emails[].html | string | Optional | HTML content (html or text required) |
| emails[].text | string | Optional | Plain text content |
Direct mode request
curl -X POST https://fwd.sarthak.online/api/send/batch \
-H "x-api-key: fwd_your_key" \
-H "Content-Type: application/json" \
-d '{
"emails": [
{
"to": "alice@example.com",
"subject": "Your invoice is ready",
"html": "<p>Invoice #001 for Alice</p>"
},
{
"to": "bob@example.com",
"subject": "Your invoice is ready",
"html": "<p>Invoice #002 for Bob</p>"
}
]
}'Response
| Field | Type | Description |
|---|---|---|
| batchId | string | Unique batch identifier for tracking |
| status | string | "processing", "completed", "partial", or "failed" |
| message | string | Human-readable status message |
| total | number | Total recipients submitted |
| queued | number | Number of emails accepted for delivery |
| suppressed | number | Recipients skipped (on suppression list) |
| duplicates | number | Duplicate emails removed |
| errors | array | Array of {index, to, error} for failed validations |
| rateLimit | object | {limit, remaining} for your plan |
Features
Built-in protections
Batch sending automatically deduplicates recipients, filters suppressed addresses, validates email formats, and respects your plan's monthly limit.
Link tracking
Links in batch emails are automatically replaced with tracked short URLs. Click data is available in the Analytics dashboard and via webhook events.