Send a test of an SMS template

Send a test of an SMS template

POST/api/v1/sms/templates/{id}/test-send

POST /sms/templates/{id}/test-send
curl -X POST 'https://www.unitpost.com/api/v1/sms/templates/tmpl_123/test-send' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{ }'
Response · 200
{
  "object": "sms_template_test_send",
  "sms_id": "sms_123"
}

Fill the template's {{variables}} and send ONE test text to to: the simulator or a number your workspace verified (403 for any other number). A real text, billed like any; from sender_id or routed by the destination's country. Every variable needs a value (422). Pass an Idempotency-Key so a retry never texts twice. Rate limited per workspace. Requires the sms:send capability.

Parameters2 fields
FieldTypeDescription
idrequiredstring · path—
Idempotency-Keystring · headerAny unique string (1–256 characters, e.g. a UUID). Retrying with the same key and the same body within 24 hours returns the first result instead of sending again; the same key with a different body is `409 invalid_idempotent_request`, and one still in flight is `409 concurrent_idempotent_requests`.
Request body3 fields
FieldTypeDescription
torequiredstringA simulator number (`+14254147755` delivers, `+14254147167` fails) or one of GET /sms/test-destinations' verified numbers (E.164).
variablesobjectValues for the template's `{{variables}}`; every one must be filled.
sender_idstringSend from this live sender (`snum_…`); default: routed like any text.
Response · 200 fields2 fields
FieldTypeDescription
objectrequiredstring—
sms_idrequiredstringThe test text (`sms_…`); read it with GET /sms/{id}.
200400401402403404409422429

Search docs and guides

Search the docs and product guides.