Skip to contentSkip to navigationSkip to topbar
On this page

Send and receive branded RCS messages (public beta)


(new)

Public Beta

Programmable Messaging Rich Communication Services (RCS) is currently available as a Public Beta product, and the information contained in this document is subject to change.

Some features aren't yet implemented, and others may change before the product becomes Generally Available (GA). Public Beta products aren't covered by a Service Level Agreement (SLA).

On this page, you'll learn to use Twilio Programmable Messaging(link takes you to an external page) to programmatically send branded RCS messages using your web application or cURL(link takes you to an external page).

To learn the advantages of RCS, see RCS Business Messaging.


Complete the prerequisites

complete-the-prerequisites page anchor

Before you send an RCS message, complete the RCS setup.


You can send RCS messages using code that makes HTTP POST requests to the Message resource(link takes you to an external page) in the Twilio REST API. Programmable Messaging proactively checks if the recipient's device can support RCS and sends the message using SMS as a fallback if needed.

To send an RCS message, follow the steps to send an SMS message, replacing the From field with the MessagingServiceSid field as shown in the following example. Set the MessagingServiceSid field to the Messaging Service SID assigned to your RCS Sender. To find your Messaging Service's SID, check the Sid column on the Messaging Services page in the Twilio Console(link takes you to an external page).

Don't set the From parameter in the API request to the RCS Sender Messaging Service SID because it prevents fallback to SMS or MMS if the RCS fails.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createMessage() {
11
const message = await client.messages.create({
12
body: "My first RCS message. Hello, world!",
13
messagingServiceSid: "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
14
to: "+155XXXXXXXX",
15
});
16
17
console.log(message.body);
18
}
19
20
createMessage();

Send an RCS message that contains media

send-an-rcs-message-that-contains-media page anchor

To send messages containing RCS-supported media formats and sizes, add the media URL to the send an RCS message code as shown in the following example. The media URL tells Twilio where to get the media you want to include.

The media URL must be a publicly accessible URL. Twilio can't reach any hidden URLs or URLs that require authentication.

Twilio automatically attempts delivery over RCS. Unsupported media formats may fall back to MMS. Devices that aren't RCS-capable receive the message by MMS in MMS-supported regions(link takes you to an external page), and Picture SMS(link takes you to an external page) elsewhere. Twilio supports combining text and media over RCS only for image and video files.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createMessage() {
11
const message = await client.messages.create({
12
mediaUrl: [
13
"https://c1.staticflickr.com/3/2899/14341091933_1e92e62d12_b.jpg",
14
],
15
messagingServiceSid: "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
16
to: "+155XXXXXXXX",
17
});
18
19
console.log(message.body);
20
}
21
22
createMessage();

Send an RCS message that contains rich content

send-an-rcs-message-that-contains-rich-content page anchor

You can create rich content using Content Templates and send that content through RCS. RCS supports the following rich content types:

Rich content support
RCS FeatureContent Type
Rich Cardtwilio/card
Chip Listtwilio/card
Basic Texttwilio/text
Mediatwilio/media
Rich Card Carouseltwilio/carousel

For devices that aren't RCS-capable, you can define customized fallback to SMS and MMS in applicable regions by defining multiple types in a Content Template.

To send rich content through RCS:

  1. Define your rich content in the API or the Twilio Console.

  2. In the API response or in the Twilio Console, find the unique Content SID starting with HX that identifies your rich content.

  3. Add the ContentSid and content variables to the send an RCS message code as shown in the following example.

    To learn more about content variables, see Using Variables.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createMessage() {
11
const message = await client.messages.create({
12
contentSid: "HXXXXXXXXXXXXX",
13
contentVariables: JSON.stringify({ 1: "Name" }),
14
messagingServiceSid: "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
15
to: "+155XXXXXXXX",
16
});
17
18
console.log(message.body);
19
}
20
21
createMessage();

When users send messages to your RCS Sender, you can see those messages on your Programmable Messaging Logs page in the Twilio Console(link takes you to an external page). You can also configure your Messaging Service to send a webhook when it receives an incoming message.


Let customers initiate a chat with your RCS Sender

let-customers-initiate-a-chat-with-your-rcs-sender page anchor

Your customers can start a chat with your RCS Sender from a deep link URL. You can embed the URL as a button, link, or QR code in an email, app or website depending on your use case.

Format the deep link URL like this: "sms:" + "{{RCS Sender ID}}" + "@rbm.goog"

To find your RCS Sender ID, click the RCS sender in the RCS Senders page in the Twilio Console(link takes you to an external page) and view the Profile Information.

You can use the Google SMS link creator(link takes you to an external page) to generate the deep link and QR code.


Monitor and analyze traffic for RCS messages that you send

monitor-and-analyze-traffic-for-rcs-messages-that-you-send page anchor

After you send RCS messages, you can monitor and analyze your RCS traffic by using Programmable Messaging Logs in the Twilio Console(link takes you to an external page) and Messaging Insights. If you don't see a log for your message, you can view errors on the Error Logs page in the Twilio Console(link takes you to an external page).

If Twilio successfully sent the message with RCS, the From field contains rcs:<SenderId>. You can view this field in the Programmable Messaging Logs in the Twilio Console(link takes you to an external page), outbound message status callbacks, and Fetch a Message resource request results.

In many regions, RCS tracks delivered and read statuses more reliably than SMS does. If you need to A/B test the two channels, we recommend using other metrics, such as clicks or conversions.