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

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

Body

FieldTypeNotes
from requiredstringSender phone number in E.164 format. matches ^\+[1-9]\d{1,14}$
to requiredstringRecipient phone number in E.164 format. matches ^\+[1-9]\d{1,14}$
template_idstringApproved template id. uuid
templatestringApproved template name (alternative to template_id). 1–100 characters
variablesobjectdefaults to {}
consent_basis required"transactional"Attestation that the recipient requested this message (transactional)
tagsstring[]at most 50
metadataobject

Responses

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

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