Send Template Messages (via API)
The Send Template API lets you trigger RCS messages from your backend. Design your message in the RCS Studio builder, then send it to any recipient with a single API call — perfect for transactional messages like order confirmations, appointment reminders, and notifications
How it works
- Design a message template in the RCS Studio builder using Liquid variables like
{{ params.firstName }}for dynamic content. - Call the API with the template ID, the recipient's phone number, and any parameters your template needs.
- RCS Studio renders the template with your parameters and delivers it via RCS.
This is a lightweight render-and-send — no connector operations or state machine processing.
Endpoint
POST /agents/:agentId/messages/:templateId/send
Request body
{
"msisdn": "+15551234567",
"params": {
"firstName": "Sarah",
"orderId": "ORD-12345"
}
}| Field | Type | Required | Description |
|---|---|---|---|
msisdn | string | Yes | Recipient phone number in E.164 format (e.g. +15551234567) |
messageId | string (UUID) | No | Correlation ID to track the message across systems. Generated automatically if not provided. |
params | object | No | Key-value pairs injected into the template as {{ params.key }} |
Response
{
"messageId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"templateId": "order-confirmation",
"msisdn": "+15551234567"
}Finding your template ID
Your template ID is the state ID from the RCS Studio builder. You can find it in the URL when editing a state, or by listing states via the API:
GET /agents/:agentId/states
Using template parameters
Your template has access to the params variable, which contains whatever you pass in the request body. See Template Variables for the full reference on all available variables.
Note: Only
paramsis available when sending via this API. Other template variables likedata,input, anduserare populated by the state machine and won't be present here.
Hi {{ params.firstName }}, your order #{{ params.orderId }} has {{ params.status }}.Nested parameters
You can pass nested objects in params and access them with dot notation:
{
"msisdn": "+15551234567",
"params": {
"customer": {
"firstName": "Sarah",
"tier": "gold"
},
"order": {
"id": "ORD-12345",
"total": "$49.99"
}
}
}Hi {{ params.customer.firstName }}, your order #{{ params.order.id }} totaling {{ params.order.total }} is confirmed.Conditionals and filters
Liquid conditionals and filters are fully supported:
{% if params.customer.tier == "gold" %}
As a Gold member, you get free shipping!
{% else %}
Standard shipping applies.
{% endif %}Updated about 1 month ago