Templates
Create a template
POST/v1/templatesrequires template:write
Requestcurl -X POST https://api.transmit.dev/v1/templates \
-H "Authorization: Bearer tr_v2_…" \
-H "Content-Type: application/json" \
-d '{
"friendly_name": "order-shipped",
"name": "Order shipped",
"subject": "Your order is on its way",
"html": "<p>Hello {{name}}, tracking: {{tracking}}.</p>"
}'Body
| Field | Type | Notes |
|---|---|---|
friendly_name required | string | 1–100 characters. matches ^[a-z0-9][a-z0-9_-]*$ |
name required | string | 1–200 characters |
subject required | string | 1–998 characters |
html | string | at least 1 characters |
text | string | at least 1 characters |
variables | object |
Responses
| Status | Meaning |
|---|---|
201 | The created template |
401 | The API key is missing, malformed, expired or revoked |
403 | The API key lacks the template:write scope |
422 | The request failed validation |
Every response body is described in the OpenAPI spec, which this page is generated from.