Send RCS message
const url = 'https://example.com/v1/agents/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/messages';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"to":"+6281234567890","text":"Hi Budi, your order ORD-12345 is confirmed. Thank you!","ttl_seconds":86400,"rbm":{"message_traffic_type":"TRANSACTION"}}'};
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/agents/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/messages \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "to": "+6281234567890", "text": "Hi Budi, your order ORD-12345 is confirmed. Thank you!", "ttl_seconds": 86400, "rbm": { "message_traffic_type": "TRANSACTION" } }'Send an RCS (Rich Communication Services) message from a verified agent.
Agent id ({agent_id} path)
Either:
- platform UUID from
GET /v1/channels→id, or - Google agent id without
@rbm.goog(same value asgoogle_agent_idon channels).
Modes (pick one)
| Mode | Body fields | Notes |
|---|---|---|
| Free-text | to, text | Optional ttl_seconds, rbm.message_traffic_type (TRANSACTION / PROMOTION / AUTHENTICATION). These apply only to free-form sends. |
| RCS template | to, rbm.name and/or rbm.rich_message_id | Optional rbm.parameters for {{1}}… placeholders. Template must be ACTIVE. Prefer name (unique per agent, Meta-style snake_case). Traffic type and TTL come from the template (same idea as WhatsApp template category) — do not pass message_traffic_type or ttl_seconds on template sends. |
Do not combine free-text with a template (rbm.name / rbm.rich_message_id).
The JSON field is still named rbm for backward compatibility; it means the RCS template object.
Use the Examples dropdown in Swagger for free-text and template sample bodies.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”UUID of the RCS agent that sends the message
Request Body required
Section titled “Request Body required ”RCS send body — free-text or RCS template (see examples).
Send an RCS message from a verified agent. Use free-text (text) OR an RCS template (rbm.name / rbm.rich_message_id) — not both. Template must be ACTIVE. On template sends, traffic type and TTL are taken from the template (not the request body).
object
Free-form only: absolute expiration (RFC3339 UTC). Ignored on template sends.
RCS template selector (+ free-form options). Required for template sends.
Free-form may set only message_traffic_type under this object.
object
Optional Meta-compat components array for body parameters (alternative to parameters).
Free-form only: optional RCS traffic type (PROMOTION, TRANSACTION,
AUTHENTICATION). Ignored on template sends — billing uses
rich_messages.default_traffic_type (then agent default).
Template name unique per RCS agent (normalized like Meta: order_confirm_v1).
Optional if rich_message_id is set.
Optional positional parameters for {{1}}, {{2}}, … in the template body.
Optional override; defaults to the path {agent_id}. If set, must match the path agent.
ACTIVE rich_messages.id. Optional if name is set.
Free-text RCS body (session / agent reply). Mutually exclusive with
template sends (rbm.name / rbm.rich_message_id). Optional traffic
type via rbm.message_traffic_type (free-form only).
Recipient MSISDN in E.164 format.
Free-form only: time-to-live in seconds (Google RCS duration).
Ignored on template sends — use rich_messages.default_ttl_seconds.
Examples
Session / free-text RCS
Plain text via the RCS agent. Optional traffic type and TTL (free-form only).
{ "to": "+6281234567890", "text": "Hi Budi, your order ORD-12345 is confirmed. Thank you!", "ttl_seconds": 86400, "rbm": { "message_traffic_type": "TRANSACTION" }}Template send (by rich_message_id)
ACTIVE template by UUID. Traffic type / TTL from the template row — not from the request.
{ "to": "+6281234567890", "rbm": { "rich_message_id": "d5e5b13f-2521-4b51-b4df-174029d2b584", "parameters": [ "Budi Santoso", "ORD-12345" ] }}Template send (by name + parameters)
ACTIVE template by name. Traffic type / TTL are taken from the template (WhatsApp-style); only parameters are in the body.
{ "to": "+6281234567890", "rbm": { "name": "order_confirm_v1", "parameters": [ "Budi Santoso", "ORD-12345" ] }}Responses
Section titled “ Responses ”RCS message accepted for processing
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" } ]}Unauthorized — invalid API key
Forbidden — RCS agent not verified
Not found — agent or RCS template (name/id) not found / not ACTIVE
Internal server error
Standard error response format.
object
object
Example generated
{ "error": { "code": 1, "message": "example", "type": "example" }}