Skip to main content

Send RCS Template Message

Send an RCS message using a pre-approved template. Supports rich media, suggested actions, and automatic SMS fallback for non-RCS capable devices.

Endpoint​

POST https://<api_key>:<api_token>@<subdomain>/v2/accounts/<your_sid>/messages
Data CenterSubdomain
Singaporeapi.exotel.com
Mumbaiapi.in.exotel.com

Authentication​

HTTP Basic Authentication using your API key and API token from the Exotel Dashboard.

Request Body​

{
"custom_data": "order_12345",
"status_callback": "https://your-server.com/rcs/callback",
"rcs": {
"from": "your_bot_id",
"to": "+919888888888",
"content": {
"name": "welcome_template",
"variables": {
"customer_name": "Rahul",
"order_id": "ORD-12345"
}
},
"fallback": {
"sms": {
"from": "ExoSMS",
"content": "Hi Rahul, your order ORD-12345 has been confirmed."
}
}
}
}

Request Parameters​

Top-Level​

ParameterTypeRequiredDescription
custom_dataStringNoCustom metadata passed through to status callbacks
status_callbackString (URL)NoWebhook URL for delivery receipt events
rcsObjectYesRCS channel configuration

RCS Object​

ParameterTypeRequiredDescription
fromStringYesBotID for sending (provided by Exotel)
toStringYesRecipient phone in E.164 format (e.g., +919888888888)
contentObjectYesTemplate message content
fallbackObjectNoSMS fallback configuration

Content Object​

ParameterTypeRequiredDescription
nameStringYesPre-approved template identifier
variablesObjectYesKey-value pairs for template variable substitution

Fallback Object​

ParameterTypeRequiredDescription
sms.fromStringYesSMS sender ID
sms.contentStringYesFallback SMS text (sent if RCS delivery fails)

Sample Response​

HTTP 202 — Accepted

{
"request_id": "f3217095-eddc-4ae8-a558-e4db0baef684",
"http_code": 202,
"metadata": {
"total": 1,
"success": 1,
"failed": 0
},
"response": {
"rcs": {
"messages": [
{
"code": 202,
"status": "success",
"data": {
"sid": "msg_abc123def456"
}
}
]
}
}
}

Status Callbacks (DLR)​

When a status_callback URL is provided, Exotel sends delivery events via POST:

Status CodeEventDescription
40001EX_MESSAGE_SENTMessage transmitted to the user's device
40002EX_MESSAGE_DELIVEREDMessage received by the device
40003EX_MESSAGE_SEENUser opened/read the message
40004EX_SYSTEM_ERRORDelivery failed due to system error

Callback Payload​

{
"sid": "msg_abc123def456",
"to": "+919888888888",
"exo_status_code": "40002",
"status": "EX_MESSAGE_DELIVERED",
"timestamp": "2026-04-17T10:30:00.000Z",
"custom_data": "order_12345"
}

Incoming Messages (Webhook)​

Configure an incoming webhook to receive messages from users. Supported content types:

Content TypeFields
Texttext — the message body
Fileurl, thumbnail_url, mime_type, size
Locationlatitude, longitude, label
Suggested Replypostback_data, text
Suggested Actionpostback_data, action_type

Error Responses​

HTTP CodeDescription
400Malformed request or missing required fields
401Invalid API credentials
402Plan limits exceeded
403Insufficient permissions
404Resource not found
5xxServer error — retry with backoff