Lewati ke konten

Unified Send with Fallback Chain

POST
/v1/messages
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.

Media type application/json

Unified send request with fallback chain support. v1 requires SMS-first chains.

object
channel_priority

Inline fallback chain. Each step specifies a channel and sender.

Array<object> | null
object
channel
required

Channel type: "sms", "whatsapp", "rbm" (RCS), "email".

string
Example
sms
from_id
required

Sender ID: SMS virtual entry_point or sms_senders.id UUID; phone_number_id for WA; agent_id for RCS.

string
Example
999123456789012
template_id
string | null format: uuid
timeout_seconds
integer | null format: int32
content
required
One of:
object
text
required
string
type
required
string
Allowed values: text
order

Sort mode: “as-given” preserves order, “cost” sorts ascending by provider_pricing.

string | null
Example
as-given
routing_policy_id

Reference to a named routing policy.

string | null format: uuid
to
required

Recipient phone number in E.164 or local format.

string
Example
6281234567890
ttl_seconds
integer | null format: int32

Message accepted

Media type application/json

Successful response after a message has been accepted for sending.

object
messages
required
Array<object>
object
id
required

The internal Message ID. Use this ID (without the ‘msg_’ prefix) to query the message status.

string
messaging_product
required
string
Example
{
"messages": [
{
"id": "msg_f7a816e2-8397-11f0-8e34-010203040506"
}
]
}

Validation error / no chain provided / non-SMS first step

Unauthorized

Internal server error