Send a Rich Multimedia Text Message
POST Method
The Send a Rich Multimedia Text Message API sends a rich multimedia message using RCS (Rich Communication Services). It supports standalone rich cards with media, title, description, and interactive suggestions like replies and actions.
Prerequisites
- After you sign up, your account will be on the trial version. You must complete the KYC to access all the features in kaleyra.io.
- Before you get started, Create an API Key. To view the API Key and the SID, see View API Key and SID.
- Before sending the RCS, you must configure the RCS channel in the Kaleyra platform. To configure the RCS channel in your account, please contact your local Kaleyra representative.
- You must have an approved AgentID or a specific number to be used as AgentID.
Base URL
https://rcs-api.<pod>.kaleyra.ai
- For North America (NA).
https://rcs-api.<pod>.kaleyra.io
- For rest of the world.
API Domain and Value
api_domain | Value |
---|---|
IN pod | https://rcs-api.in.kaleyra.io |
NA pod | https://rcs-api.na.kaleyra.ai |
API request to send a Rich Multimedia Text message
To send a rich multimedia text message, use the https://rcs-api.<pod>.kaleyra.ai/v1/<sid>/rcs/messages
endpoint with the following request method:
The following is the request format to send a rich multimedia text message:
curl --location --request POST 'https://<api_domain>/v1/<sid>/rcs/messages'\
--header 'Content-Type:<Content-Type>'\
--header 'api-key: <api-key>'\
--data {
"from": "<from>",
"to": ["<to>"],
"richCardStandalone": {
"cardOrientation": "<cardOrientation>",
"content": {
"title": "<title>",
"description": "<description>",
"media": {
"height": "<height>",
"file": {
"fileUrl": "<fileUrl>",
"thumbnailUrl": "<thumbnailUrl>",
"contentDescription": "<contentDescription>"
}
},
"suggestions": [
{
"reply": {
"text": "<replyText>",
"postbackData": "<replyPostbackData>",
"openUrlAction": {
"url": "<replyUrl>"
}
}
},
{
"action": {
"text": "<actionText>",
"postbackData": "<actionPostbackData>",
"openUrlAction": {
"url": "<actionUrl>"
}
}
}
]
}
}
}
The following is the sample request that describes how to send a rich multimedia text message:
curl --location --request POST 'https://rcs-api.na.kaleyra.ai/v1/xxxxx6913850xxxx/rcs/messages'\
--header 'Content-Type: application/json' \
--header 'api-key: xxxxx3b8497f58a94e84b671aca43xxxx' \
--data '
{
"from":"rcs-dev",
"to":["[9177xxxxx]", "[195xxxxx01]"
],
"richCardStandalone":{
"cardOrientation":"VERTICAL",
"content":{
"title":"TATA Communications",
"description":"",
"media":{
"height":"MEDIUM",
"file":{
"fileUrl":"https://i.pinimg.com/736x/db/15/3f/db153ff5580c40fe7577d9fa7713f973.jpg",
"thumbnailUrl":"https://i.pinimg.com/736x/db/15/3f/db153ff5580c40fe7577d9fa7713f973.jpg",
"contentDescription":"C634893 - caption"
}
},
"suggestions":[
{
"reply":{
"text":"Interested in A2P Service",
"postbackData":"C634889_response_reply",
"openUrlAction":{
"url":"https://www.tatacommunications.com"
}
}
},
{
"action":{
"text":"Interested in P2P Service",
"postbackData":"C634889_response_action",
"openUrlAction":{
"url":"https://www.tatacommunications.com"
}
}
}
]
}
}
}
URL Parameters and Headers
The following is the list of parameters and headers to send the outgoing message request:
Parameter/Headers | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
sid | String | Account SID (Security Identifier). | xxxxx6913850xxxx | Yes |
Content-Type | String | Indicates the format of the content the API will be processing. | The only allowed value is application/JSON | Yes |
api-key | String | API key generated from kaleyra.io account. | xxxxx3b8497f58a94e84b671aca43xxxx | Yes |
Following is the list of attributes to be used in the payload to send the messages:
Parameter | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
from | String | The service code unique to the agent, specified when the agent is created/onboarded. | "rcs-dev" | Yes |
to | Array of String | List of recipients’ device addresses (100 max.), which can either be a phone number in E.164 format prefixed with the country code without a plus sign, or a URI-like identification used to contact the user. | ["[9177xxxxx]", "[195xxxxx01]"] | Yes |
richCardStandalone | JSON Object | Container for rich card content. | See the specific table for details. | Yes |
The following table describes the different attributes used for the richCardStandalone
JSON object:
Parameter | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
cardOrientation | String | Defines the layout direction of the rich card’s content, specifying whether the card elements (like images, text, buttons, and chips) are arranged horizontally or vertically. | "VERTICAL" | Yes |
content | JSON Object | The content of the rich card. | See the specific table for details. | Yes |
The following table describes the different attributes used for the content
JSON object:
Parameter | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
title | String | Title of the rich card. | "CIS Global Gateway" | Yes |
description | String | Description text of the rich card (2000 Unicode characters max). | "Testing Rich Business Messaging Capabilities" | Yes |
media | JSON Object | Media to be included in a rich card. | See the specific table for details. | No |
suggestions | JSON Object | List of chiplist items (quick replies or actions). | See the specific table for details. | No |
The following table describes the different attributes used for the media
JSON object:
Parameter | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
height | String | Height of the media (SHORT, MEDIUM, TALL) | "MEDIUM" | Yes |
file | JSON Object | File message content to send to the users’ device, typically an image, audio, or a video file. | See the specific table for details. | Yes |
The following table describes the different attributes used for the file
JSON object:
Parameter | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
fileUrl | String | Public accessible URL of the media file (image or video). | "https://live.staticflickr.com/...jpg " | Yes |
thumbnailUrl | String | Public accessible URL of the thumbnail image. | "https://live.staticflickr.com/...jpg " | No |
contentDescription | String | Description of the media content for accessibility. | "C634893 - caption" | No |
The following table describes the different attributes used for the suggestions
JSON object:
Parameter | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
reply | JSON Object | Contains the details of the reply chip. | See the specific table for details. | Yes (if reply) |
action | JSON Object | Contains the details of the action chip. | See the specific table for details. | Yes (if action) |
The following table describes the different attributes used for the reply
JSON object:
Parameter | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
text | String | Text displayed on the reply chip. | "Thank you!" | Yes (if reply) |
postbackData | String | Data sent back to your system when the reply chip is clicked. | "more_info" | Yes (if reply) |
openUrlAction | JSON Object | Contains the URL to open when the reply chip is clicked. | See the specific table for details. | Yes (if reply) |
The following table describes the different attributes used for the action
JSON object:
Parameter | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
text | String | Text displayed on the action chip. | "Visit Website" | Yes (if action) |
postbackData | String | Data sent back to your system when the action chip is clicked. | "tata_comm_website" | Yes (if action) |
openUrlAction | JSON Object | Contains the URL to open when the action chip is clicked. | See the specific table for details. | Yes (if action) |
The following table describes the different attributes used for the openUrlAction
JSON object:
Parameter | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
url | String | A URL, as defined by RFC 2396 (4000 Unicode characters max). | https://www.tatacommunications.com/ | Yes (if reply/action) |
Sample Success Response
The following success message appears:
{
"recipientDetails": [
{
"to": "9191588XXXXX",
"messageId": "dc4cxxxx-xxxx-xxxx-xxxx-xxxx349a5e3d "
}
]
}
The following examples illustrate typical success responses generated during the lifecycle of a message transmitted using the messaging platform. These responses represent key stages in message delivery, including successful submission to the carrier, delivery to the recipient's device, and confirmation of message read status. Each response includes metadata such as timestamps, message identifiers, and event types, which can be used for tracking and diagnostics.
Sent
The messages that are successfully submitted from Google to the carrier.
{
"type": "SENT",
"eventId": "c8c3aa5d-1082-45a9-9f88-026c9XXXXX94",
"from": "9176739XXX02",
"to": "mmx_traffic",
"sentAt": "2025-06-16T13:46:38.929Z",
"messageId": "4543932d-c8f0-48c4-90bf-f9aXXXXXX2095f"
}
Delivered
The messages that are successfully delivered to the recipient's handset.
{
"type": "DELIVERED",
"eventId": "MxfdhMDmfXXXXXQQBlrIGcIg",
"from": "91767XXXXXX2",
"to": "mmx_traffic",
"sentAt": "2025-06-16T13:46:41.295Z",
"messageId": "4543932d-c8f0-48c4-90bf-f9aXXXXX005f"
}
Read
The messages that have been read on the recipient's handset.
{
"type": "READ",
"eventId": "MxZJragNjfT=qY4XXXXXYxcA",
"from": "917673XXXXX2",
"to": "mmx_traffic",
"sentAt": "2025-06-16T13:46:49.193Z",
"messageId": "4543932d-c8f0-48c4-90bf-f9aXXXXX005f"
}
Error
The messages that have been undelivered.
For information related to error codes, see RCS Error Codes.
Updated about 8 hours ago