SMS
Send an SMS
POST/v1/smsrequires sms:send
Transactional only. The body comes from an approved template rendered with your variables; there is no free-text body, and every send attests the consent basis.
Requestcurl -X POST https://api.transmit.dev/v1/sms \
-H "Authorization: Bearer tr_v2_…" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"from": "+18885550100",
"to": "+12025550100",
"template": "otp",
"variables": {
"code": "483920"
},
"consent_basis": "transactional"
}'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 | Sender phone number in E.164 format. matches ^\+[1-9]\d{1,14}$ |
to required | string | Recipient phone number in E.164 format. matches ^\+[1-9]\d{1,14}$ |
template_id | string | Approved template id. uuid |
template | string | Approved template name (alternative to template_id). 1–100 characters |
variables | object | defaults to {} |
consent_basis required | "transactional" | Attestation that the recipient requested this message (transactional) |
tags | string[] | at most 50 |
metadata | object |
Responses
| Status | Meaning |
|---|---|
202 | Queued |
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 sms:send scope |
422 | The request failed validation |
Every response body is described in the OpenAPI spec, which this page is generated from.