Unified Send with Fallback Chain
const url = 'https://example.com/v1/messages';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"channel_priority":[{"channel":"sms","from_id":"999123456789012","template_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","timeout_seconds":1}],"content":{"text":"example","type":"text"},"order":"as-given","routing_policy_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","to":"6281234567890","ttl_seconds":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/messages \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "channel_priority": [ { "channel": "sms", "from_id": "999123456789012", "template_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "timeout_seconds": 1 } ], "content": { "text": "example", "type": "text" }, "order": "as-given", "routing_policy_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "to": "6281234567890", "ttl_seconds": 1 }'Sends a message through a fallback chain of channels/suppliers. v1 requires the first step to be SMS. Accepts inline channel_priority or a routing_policy_id reference.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Unified send request with fallback chain support. v1 requires SMS-first chains.
object
Inline fallback chain. Each step specifies a channel and sender.
object
Channel type: "sms", "whatsapp", "rbm" (RCS), "email".
Example
smsSender ID: SMS virtual entry_point or sms_senders.id UUID; phone_number_id for WA; agent_id for RCS.
Example
999123456789012Sort mode: “as-given” preserves order, “cost” sorts ascending by provider_pricing.
Example
as-givenReference to a named routing policy.
Recipient phone number in E.164 or local format.
Example
6281234567890Responses
Section titled “ Responses ”Message accepted
Successful response after a message has been accepted for sending.
object
object
The internal Message ID. Use this ID (without the ‘msg_’ prefix) to query the message status.
Example
{ "messages": [ { "id": "msg_f7a816e2-8397-11f0-8e34-010203040506" } ]}Validation error / no chain provided / non-SMS first step
Unauthorized
Internal server error