Skip to main content
POST
Send an SMS

Authorizations

Authorization
string
header
required

Dashboard JWT token from Clerk

Headers

Idempotency-Key
string

Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the Idempotency-Replay: true response header.

Required string length: 1 - 255
X-Test-Mode
enum<string>

Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Available options:
true,
false

Body

application/json
to
string
required

Phone number. Accepts E.164 (preferred) or display formats and PBX-extension suffixes (x1234, ;ext=1234, ,ext=1234); normalized server-side to E.164 before send.

Required string length: 1 - 64
body
string

SMS body text. Optional when media_url or media_urls is set (caption-less MMS).

Maximum string length: 1600
webhook_url
string

DLR callback URL (HTTPS). Optional — an empty string is treated as 'no webhook'. Non-empty values are validated server-side: must be https:// and pass the SSRF guard.

Maximum string length: 2048
metadata
object

Custom key-value metadata

test
boolean

When true, marks this send as a throwaway test. The provider call still happens and billing still runs, but the recipient is NOT auto-upserted into the contacts table. Use this for dashboard 'Send Test SMS' flows to avoid polluting the operator's contacts list with verification numbers. TEST-USER P1 / DECISION — TEST_SMS_NO_CONTACT_CREATE_2026_05_28.

validity_period
string

Twilio ValidityPeriod parity. Carrier-level expiry hint after which the SMSC drops the attempt. Suffixed grammar: s (seconds, default), m (minutes), h (hours), d (days). Examples: '30m', '1h', '24h', '2d'. Consumed by Telnyx (valid_until), Jasmin (validity-period), and SMPP (validity_period hours). GAP2_CPaaS_33.

Pattern: ^[1-9][0-9]*[smhd]?$
max_price
number

Twilio MaxPrice parity. Hard per-message USD ceiling. The send is rejected 422 MAX_PRICE_EXCEEDED if the resolved per-unit cost exceeds this cap — useful as an anti-fraud guard on international SMS to premium-rate destinations. Capped at 100 USD per message to defend against units mistakes. GAP2_CPaaS_33.

Required range: 0 < x <= 100
fallback_from
string

Twilio FallbackFrom parity. An optional secondary sender identity recorded on the message as metadata.fallback_from for audit and record-keeping. Same allowed shape as from (E.164 / alphanumeric sender ID / __shared_generic__). Audit-only: the value is stored on the message record and is not currently auto-swapped in on a rejected attempt, so treat it as a record of intent rather than an active carrier-failover retry.

Required string length: 1 - 64
from
string

Sender identity: E.164 phone number, alphanumeric sender ID (1-11 characters with letters + spaces), short code (3-8 digits), or the platform sentinel __shared_generic__. Normalized and validated server-side.

Required string length: 1 - 64
contact_id
string

Optional reference to a contact in the tenant's contacts table. When provided, the API resolves the contact's phone and uses it as the recipient, overriding the to field. Used by the dashboard inbox when the operator has only the display-masked contact value.

Maximum string length: 100
media_url
string

Media attachment URL (HTTPS). Auto-upgrades SMS to MMS when present. Validated server-side for HTTPS scheme and SSRF safety.

media_urls
string[]

Array of media attachment URLs (up to 10). Auto-upgrades SMS to MMS. Each URL validated server-side for HTTPS scheme and SSRF safety.

Maximum array length: 10
scheduled_at
string

ISO 8601 datetime for scheduled delivery. Must be in the future and within the tenant's schedule window. Accepts both full ISO 8601 strings (e.g., '2026-04-16T14:30:00Z') and datetime-local values (e.g., '2026-04-16T14:30'). Validated server-side.

shorten_urls
boolean

When true, auto-shorten any URLs in the message body using the tenant's configured link shortener. Link-tracking metadata is preserved.

track_clicks
boolean

When true, track clicks on shortened links via redirect analytics. Only applies when shorten_urls is true.

flash_sms
boolean

When true, send as a Flash SMS (Class 0) that displays immediately on the recipient device without saving to the inbox. Not supported by all carriers.

Response

SMS accepted for delivery

SMS accepted for delivery

data
object
meta
object