Send an RCS message

Sends an RCS message to one or more recipients. Two mutually-exclusive modes are supported:

  • Template send: pass template_id (from a template created via POST /rcs/templates/*) and no agent_id — the message goes out as the template's agent. Use template_variables to give the value of every {{N}} placeholder of the template — the template's default_variables are not used to fill a send, and a placeholder left out returns 422.
  • Freeform send: pass message (capped at 306 characters because the same content is reused as the SMS fallback) and agent_id.

Exactly one of template_id or message must be provided. Devices that don't support RCS receive the SMS fallback automatically — taken from the template's fallback_message for template sends, or from message itself for freeform sends.

The endpoint returns 202 Accepted immediately; delivery status arrives later via the configured webhook, as campaign.status events whose status is sent, delivered, read, undelivered, failed or insufficient_credits — the last one when the account's RCS balance did not cover this message at send time (a long Basic message can cost more than one unit): the message was not sent, and that phone gets no other status, not even sent. An SMS fallback reports as campaign.type: "sms" with the same campaign_id, with the SMS statuses of the account's webhook format (see the webhooks guide).

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

template_id without agent_id or message: the agent comes from the template.

phones
array of strings
required
length between 1 and 10000

Recipient phone numbers. Accepts national 11-digit, international with +55, or DDI form. At most 10,000 numbers per request: a longer list is a 422. A body over 250 KB, around 15,000 numbers, is refused before that, with a 413.

phones*

Optional. Country calling code of the numbers, as a string or a number, with or without +. RCS delivers only to Brazil, so the only accepted value is 55, which is also the default; any other is a 422.

uuid

Which registered agent the message goes out as — the brand the recipient sees on the device. It is the id returned by POST /rcs/agents.

Required on a freeform send (message), and refused on a template send (template_id). A template belongs to one agent — the one declared when it was created — and is registered in the supplier project of that agent's line, so a template send always goes out as the template's agent; sending agent_id with template_id returns 422.

On a freeform send it is required even when the app has a single approved agent. It is never inferred from the app: an app may hold more than one agent (one for verification codes, another for offers), and guessing is what would deliver under the wrong brand — a failure that does not show up in a log, only on the recipient's phone.

string
required

Identifier returned by POST /rcs/templates/*. Mutually exclusive with message.

template_variables
array of objects

The value of every {{N}} placeholder of the template (body, header, card headers and bodies; a placeholder in an open_url button URL also needs a value, though depending on how your account's RCS is routed the URL may be sent as written). Required for each placeholder: the template's default_variables are not used to fill a send, and a placeholder with no key here returns 422 naming it, before the send is queued. Extra keys are not refused. Same array-of-pairs format used by the template-creation endpoints.

template_variables
string
length ≤ 306

Freeform message body for template-less sends. Capped at 306 chars because the same text is reused as the SMS fallback. Mutually exclusive with template_id.

uri
length ≤ 512

Optional. URL that receives the status events (campaign.status) of this send instead of the app's webhook URL. It is called exactly as written, query string included, so it can carry your own identifiers (for example ?order=123). Replies to an SMS (sms.inbound) keep going to the app's webhook URL. Must use http or https, have a public hostname without underscores and be at most 512 characters; private and reserved addresses are refused. No authentication header is sent to it.

Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json