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

NameInNotes
Idempotency-Key requiredheaderA unique key, at most 255 characters. Replaying it returns the original result instead of billing twice.

Body

FieldTypeNotes
from requiredstring1–320 characters
from_namestring1–255 characters
to requiredstring or string[]
ccstring or string[]
bccstring or string[]
reply_tostringemail
subjectstringat most 998 characters
htmlstring
textstring
template_idstringuuid
template_friendly_namestring1–255 characters
variablesobject
tagsstring[]at most 50
headersobject
attachmentsobject[]at most 20
scheduled_forstringdate-time
batch_idstring1–255 characters
message_stream"transactional" | "broadcast"defaults to "transactional"
track_opensbooleandefaults to true
track_clicksbooleandefaults to true

Responses

StatusMeaning
202Queued, or scheduled if scheduled_for was set
400The Idempotency-Key header is missing or too long
401The API key is missing, malformed, expired or revoked
403The API key lacks the email:send scope
422The request failed validation

Every response body is described in the OpenAPI spec, which this page is generated from.