Skip to main content
POST
Send a message

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

Recipient identifier (E.164 phone or email)

body
string

Message body text (required unless template_name or media_url is set). An empty string is treated the same as an omitted value.

channel
string

Delivery channel — defaults to auto-routing when omitted

Maximum string length: 32
template_name
string

Approved template to send instead of a freeform body (e.g. WhatsApp template name).

language
string

BCP-47 language code for the template (e.g. en_US).

variables
object

Template substitution variables (Twilio-parity scalar map).

media_url
string

HTTPS URL of a media attachment (MMS / WhatsApp single-attachment). At least one of body, template_name, or media_url is required. An empty string is treated the same as an omitted value.

Maximum string length: 2048
from
string

Sender identity: E.164 phone number, alphanumeric sender ID (1-11 characters), short code, or the platform sentinel __shared_generic__. Normalized and validated server-side. Defaults to the account sender when omitted.

Maximum string length: 64
webhook_url
string

Per-send DLR callback URL (HTTPS, Twilio StatusCallback parity). Optional — an empty string is treated as 'no webhook'. Non-empty values must be https:// and pass the SSRF guard.

Maximum string length: 2048
scheduled_at
string

ISO 8601 datetime for scheduled delivery. Accepts a full ISO 8601 string (e.g. 2027-01-01T12:00:00Z) or a datetime-local value (e.g. 2027-01-01T12:00). Validated server-side; the message is persisted as scheduled until the target time.

metadata
object

Arbitrary key-value metadata (Twilio-parity scalar values), echoed back on delivery-status webhooks and message lookups.

country
string

ISO 3166-1 alpha-2 country hint (e.g. US). Disambiguates national-format recipient numbers and gates short-code validation.

Maximum string length: 2

Response

Message accepted for delivery

Message accepted for delivery

data
object
meta
object