Compatibility
Send an email, SendGrid-shaped
POST/v3/mail/sendrequires email:send
The same send as POST /v1/emails, at the path and in the body shape a SendGrid client already uses. Each personalization becomes one message, so a payload addressed to three queues three. categories become tags, send_at becomes scheduled_for, and dynamic_template_data becomes variables; a SendGrid dynamic template id (d-…) names a template that lives in SendGrid, so it is refused. Answers 202 with an empty body and the id in X-Message-Id, as SendGrid does.
Requestcurl -X POST https://api.transmit.dev/v3/mail/send \
-H "Authorization: Bearer tr_v2_…" \
-H "Content-Type: application/json" \
-d '{
"personalizations": [
{
"to": [
{
"email": "you@example.com"
}
]
}
],
"from": {
"email": "hello@yourdomain.com"
},
"subject": "It arrived.",
"content": [
{
"type": "text/plain",
"value": "Nobody noticed."
}
]
}'Body
| Field | Type | Notes |
|---|---|---|
personalizations required | object[] | at most 50 |
from required | object | |
reply_to | object | |
subject | string | |
content | object[] | |
attachments | object[] | |
template_id | string | |
headers | object | |
categories | string[] | |
send_at | integer | -9007199254740991–9007199254740991 |
Responses
| Status | Meaning |
|---|---|
202 | Queued. X-Message-Id carries the first id, X-Message-Ids all of them. |
401 | The API key is missing, malformed, expired or revoked |
403 | The API key lacks the email:send scope |
422 | The request failed validation, or names something we will not silently ignore |
Every response body is described in the OpenAPI spec, which this page is generated from.