Emails
Send an email
POST/v1/emailsrequires email:send
Accepts the message, charges the credits and queues it. The response is the receipt for the submission, not the delivery; delivery events arrive on your webhook.
Send either a body — subject plus html or text — or a template, by template_id or template_friendly_name but not both. JSON Schema cannot express that, so those fields are all optional below and the API answers 422 when the combination is wrong.
Requestcurl -X POST https://api.transmit.dev/v1/emails \
-H "Authorization: Bearer tr_v2_…" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"from": "Acme <hello@yourdomain.com>",
"to": "you@example.com",
"subject": "It arrived.",
"html": "<p>Nobody noticed. That is the job.</p>"
}'Parameters
| Name | In | Notes |
|---|---|---|
Idempotency-Key required | header | A unique key, at most 255 characters. Replaying it returns the original result instead of billing twice. |
Body
| Field | Type | Notes |
|---|---|---|
from required | string | 1–320 characters |
from_name | string | 1–255 characters |
to required | string or string[] | |
cc | string or string[] | |
bcc | string or string[] | |
reply_to | string | |
subject | string | at most 998 characters |
html | string | |
text | string | |
template_id | string | uuid |
template_friendly_name | string | 1–255 characters |
variables | object | |
tags | string[] | at most 50 |
headers | object | |
attachments | object[] | at most 20 |
scheduled_for | string | date-time |
batch_id | string | 1–255 characters |
message_stream | "transactional" | "broadcast" | defaults to "transactional" |
track_opens | boolean | defaults to true |
track_clicks | boolean | defaults to true |
Responses
| Status | Meaning |
|---|---|
202 | Queued, or scheduled if scheduled_for was set |
400 | The Idempotency-Key header is missing or too long |
401 | The API key is missing, malformed, expired or revoked |
403 | The API key lacks the email:send scope |
422 | The request failed validation |
Every response body is described in the OpenAPI spec, which this page is generated from.