Send or schedule an email
POST/api/v1/email
POST /email
curl -X POST 'https://www.unitpost.com/api/v1/email' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'User-Agent: my-app/1.0' \
-H 'Content-Type: application/json' \
-d '{
"from": "you@yourdomain.com",
"to": "customer@example.com",
"subject": "Welcome to Acme",
"html": "<h1>Hello</h1>"
}'Response · 200
{
"id": "id_123",
"status": "queued",
"scheduled_at": "2026-01-01T00:00:00.000Z"
}Send a single transactional email — now, or at a future time by passing scheduled_at. Provide the content inline as html/text, or reference a saved template with template (create one with Create a template). Pass an Idempotency-Key header to make retries safe: the same key replays the original result instead of sending twice. The response returns the new email's id — read its delivery status back with Retrieve an email, change a scheduled send with Cancel or reschedule an email, or send many at once with Send a batch of emails. Requires the emails:send capability.
Request body16 fields
| Field | Type | Description |
|---|---|---|
fromrequired | string | Sender address on one of your verified domains. Accepts a bare address ("hi@acme.com") or a display name ("Acme <hi@acme.com>") — the name is what inbox clients show next to the message. |
torequired | object | — |
subject | string | — |
cc | object | — |
bcc | object | — |
reply_to | object | — |
in_reply_to | string | — |
headers | object | — |
tags | object[] | — |
template | object | Published template plus variable values. Mutually exclusive with `html` and `text`. |
html | string | HTML MIME body. It is sanitized for email safety and may be supplied with `text` to create a multipart alternative. This field does not parse Markdown. |
text | string | Plain-text MIME body. Newline characters are preserved; Markdown and rich-text styling are not interpreted. It may be supplied with `html` as the fallback alternative. When `html` is sent without `text`, a plain-text alternative is derived from the visible HTML content; an explicit `text` value is always sent unchanged. |
attachments | object[] | — |
open_tracking | boolean | — |
click_tracking | boolean | — |
scheduled_at | string | — |
Response · 200 fields3 fields
| Field | Type | Description |
|---|---|---|
idrequired | string | — |
statusrequired | enumqueued | scheduled | — |
scheduled_atrequired | string | — |
200401403404409422429