Check whether a recipient’s device supports RCS — and which features it supports — before sending. This lets you adapt your message format (rich card vs. plain text) and fall back to SMS when needed.
Query single number
Check RCS capabilities for a single phone number:
curl -s https://api.telnyx.com/v2/messaging/rcs/capabilities/{agent_id}/{phone_number} \
-H "Authorization: Bearer YOUR_API_KEY"
Response examples
{
"data" : {
"record_type" : "rcs.capabilities" ,
"phone_number" : "+15559876543" ,
"agent_id" : "your_agent_id" ,
"agent_name" : "Acme Bot" ,
"features" : [
"ACTION_CREATE_CALENDAR_EVENT" ,
"ACTION_DIAL" ,
"ACTION_OPEN_URL" ,
"ACTION_OPEN_URL_IN_WEBVIEW" ,
"ACTION_SHARE_LOCATION" ,
"ACTION_VIEW_LOCATION" ,
"RICHCARD_CAROUSEL" ,
"RICHCARD_STANDALONE"
],
"status" : "Success"
}
}
{
"data" : {
"features" : [ "GENERIC_RCS_FEATURE" ],
"status" : "Success"
}
}
The device supports RCS but specific features couldn’t be determined. Send basic RCS text — avoid rich cards. {
"data" : {
"features" : null ,
"status" : "RCS is disabled or agent is not provisioned for the carrier"
}
}
Fall back to SMS/MMS for this recipient.
Feature reference
Feature Description Use for RICHCARD_STANDALONESingle rich card support Product cards, order updates RICHCARD_CAROUSELSwipeable carousel cards Product listings, menus ACTION_OPEN_URLOpen URL button Links to websites ACTION_OPEN_URL_IN_WEBVIEWOpen URL in webview In-app browsing ACTION_DIALPhone call button Click-to-call ACTION_VIEW_LOCATIONView map location Directions, store locator ACTION_SHARE_LOCATIONShare user’s location Delivery tracking ACTION_CREATE_CALENDAR_EVENTAdd calendar event Appointment booking ACTION_COMPOSECompose message Message drafting GENERIC_RCS_FEATUREBasic RCS (details unknown) Text-only RCS
Bulk capability query
Check up to 100 numbers at once to efficiently segment your audience:
curl -X POST https://api.telnyx.com/v2/messaging/rcs/bulk_capabilities \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"agent_id": "your_agent_id",
"phone_numbers": ["+15551234567", "+15559876543", "+15550001111"]
}'
RCS capability queries can be slow (several seconds per request). For time-sensitive applications, cache results and refresh periodically rather than querying before every message.
Send with automatic fallback
Use capability queries to send the best possible message format:
def send_adaptive_message ( to : str , title : str , body : str , image_url : str = None ):
"""Send RCS rich card if supported, otherwise fall back to SMS."""
caps = check_rcs_capabilities(to)
if caps[ "supports_rich_cards" ] and image_url:
# Send rich card
requests.post(
"https://api.telnyx.com/v2/messages/rcs" ,
headers = { ** headers, "Content-Type" : "application/json" },
json = {
"agent_id" : AGENT_ID ,
"to" : to,
"messaging_profile_id" : PROFILE_ID ,
"agent_message" : {
"content_message" : {
"rich_card" : {
"standalone_card" : {
"card_orientation" : "VERTICAL" ,
"card_content" : {
"title" : title,
"description" : body,
"media" : {
"height" : "MEDIUM" ,
"content_info" : { "file_url" : image_url},
},
},
}
}
}
},
"fallback" : {
"from" : FROM_NUMBER ,
"text" : f " { title } \n { body } " ,
},
},
)
elif caps[ "rcs_enabled" ]:
# Send RCS text (no rich card support)
requests.post(
"https://api.telnyx.com/v2/messages/rcs" ,
headers = { ** headers, "Content-Type" : "application/json" },
json = {
"agent_id" : AGENT_ID ,
"to" : to,
"messaging_profile_id" : PROFILE_ID ,
"agent_message" : {
"content_message" : { "text" : f " { title } \n { body } " }
},
"fallback" : { "from" : FROM_NUMBER , "text" : f " { title } \n { body } " },
},
)
else :
# Send SMS directly
requests.post(
"https://api.telnyx.com/v2/messages" ,
headers = { ** headers, "Content-Type" : "application/json" },
json = { "from" : FROM_NUMBER , "to" : to, "text" : f " { title } \n { body } " },
)
RCS Deeplinks
Deeplinks let users start an RCS conversation from a website, email, or QR code — without having your number saved.
Generate a deeplink
# With fallback phone number and message body
curl -s 'https://api.telnyx.com/v2/messages/rcs/deeplinks/{agent_id}?phone_number=%2B15554443333&body=hello%20world' \
-H "Authorization: Bearer YOUR_API_KEY"
# Without fallback (RCS only)
curl -s 'https://api.telnyx.com/v2/messages/rcs/deeplinks/{agent_id}' \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"data" : {
"url" : "sms:+18445550001?service_id=agent_id%40rbm.goog&body=hello%20world"
}
}
Use deeplinks
Convert the deeplink URL to a QR code for print materials, in-store signage, or business cards. Users scan with their camera to open an RCS conversation.
Include the deeplink in marketing emails as a CTA button. When tapped on Android with Google Messages, it opens the RCS conversation directly.
Requirements
Requirement Details Device Android with Google Messages installed OS version messages.android_20241029_00 or laterFallback Use phone_number parameter for non-RCS devices (opens SMS instead)