Lewati ke konten

Send RCS message

POST
/v1/agents/{agent_id}/messages
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 as google_agent_id on channels).

Modes (pick one)

ModeBody fieldsNotes
Free-textto, textOptional ttl_seconds, rbm.message_traffic_type (TRANSACTION / PROMOTION / AUTHENTICATION). These apply only to free-form sends.
RCS templateto, rbm.name and/or rbm.rich_message_idOptional 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.

agent_id
required
string format: uuid

UUID of the RCS agent that sends the message

RCS send body — free-text or RCS template (see examples).

Media type application/json

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
expire_time

Free-form only: absolute expiration (RFC3339 UTC). Ignored on template sends.

string | null
media
One of:
null
rbm
One of:
null
sms_failover
One of:
null
text

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).

string | null
to
required

Recipient MSISDN in E.164 format.

string
ttl_seconds

Free-form only: time-to-live in seconds (Google RCS duration). Ignored on template sends — use rich_messages.default_ttl_seconds.

integer | null format: int32
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"
}
}

RCS message accepted for processing

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"
}
]
}

Unauthorized — invalid API key

Forbidden — RCS agent not verified

Not found — agent or RCS template (name/id) not found / not ACTIVE

Internal server error

Media type application/json

Standard error response format.

object
error
required
object
code
required
integer format: int32
message
required
string
type
required
string
Example generated
{
"error": {
"code": 1,
"message": "example",
"type": "example"
}
}