Email API
Send Email
POST /api/v1/emails
X-API-Key: {api-key}Request
json
{
"from": "[email protected]",
"to": ["[email protected]"],
"cc": ["[email protected]"],
"bcc": ["[email protected]"],
"subject": "Hello World",
"html": "<h1>Hello</h1><p>World</p>",
"text": "Hello World",
"reply_to": "[email protected]",
"headers": {
"X-Custom-Header": "value"
}
}| Field | Required | Description |
|---|---|---|
from | Yes | Sender email (must be from a verified domain) |
to | Yes | Array of recipient emails |
subject | Yes | Email subject line |
html | Yes* | HTML body |
text | No | Plain text body (auto-generated from HTML if omitted) |
cc | No | CC recipients |
bcc | No | BCC recipients |
reply_to | No | Reply-to address |
template_id | No | Use a saved template instead of inline content |
variables | No | Template variable substitutions |
* Required unless template_id is provided.
Response
json
{
"message_id": "msg_abc123",
"status": "queued"
}Send Batch
POST /api/v1/emails/batch
X-API-Key: {api-key}json
{
"from": "[email protected]",
"emails": [
{
"to": "[email protected]",
"subject": "Hi Alice",
"html": "<p>Hello Alice</p>",
"variables": { "name": "Alice" }
},
{
"to": "[email protected]",
"subject": "Hi Bob",
"html": "<p>Hello Bob</p>",
"variables": { "name": "Bob" }
}
],
"template_id": "tmpl_abc123"
}Response
json
{
"batch_id": "batch_abc123",
"total": 2,
"queued": 2
}