Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

twilio/carousel



Overview

overview page anchor

Twilio/carousel is a low friction, yet highly rich way to send an end user a selection of your services, products, or any options that fit the conversation.

What is supported for end users

what-is-supported-for-end-users page anchor
  • Send a horizontally scrolling list of carousel cards.
  • Send media, text, call to action buttons, and quick reply buttons in each carousel card.
  • Send any combination of quick reply, url, and phone call buttons in each card. Multiple of the same type of buttons are also allowed so long as there are 1 to 2 buttons in each card.
  • Media can be images or videos.

WhatsApp, RCS (Coming Soon)

carousel content template 1- message preview.
carousel content template 2- message preview.
carousel content template 3- message preview.

To send carousels, you will need to:

to-send-carousels-you-will-need-to page anchor
  1. Have media URLs for each card ready prior to template creation.
  2. Create twilio/carousel content template.
  3. If it will be used on WhatsApp, approve the template.
  4. Send the Content Template containing the carousel.

To send a Carousel to open a business initiated session or to reply within a 24 hour user initiated session, template approval is required.


Creating your content template

creating-your-content-template page anchor
carousel content template 1- data preview.
carousel content template 2- data preview.

twilio/carousel

twiliocarousel page anchor

body:

  • Type: string
  • Required: Yes
  • Variable Support: Yes
  • Description: Content of the initial message delivered to the end user above the carousel.

cards:

  • Type: array
  • Required: Yes
  • Variable Support: No
  • Description: Array of Carousel cards to be sent

title:

  • Type: string
  • Required: No
  • Variable Support: Yes
  • Description: Header text of each carousel card. Max character limit is 160 combined with body text.

body:

  • Type: string
  • Required: Yes
  • Variable Support: Yes
  • Description: Body text of each carousel card. Max character limit is 160 combined with body text.

media:

actions:

  • Type: array
  • Required: Yes
  • Variable Support: Yes
  • Description: All Carousels must contain at least 1 button and at most 2 buttons. Buttons are defined using the actions array.
(information)

Info

The order of quick reply, url, and phone number buttons in a card must appear in the same order for every card.

QUICK_REPLY:

  • parameters
    • type: QUICK_REPLY
    • title: Button text of quick reply button. Appears in Body and ButtonText fields in inbound when selected by end user.
    • id: Not visible to end user. Appears in ButtonPayload fields in inbound when selected by end user.

URL:

  • parameters
    • type: URL
    • title: Button text of URL redirect button. Variables are not supported. Max 25 chars.
    • url: URL opened when end user clicks the button. Variables are supported at the end of the url string.

PHONE:

  • parameters
    • type: PHONE
    • title: Button text of URL redirect button. Variables are not supported. Max 25 chars.
    • phone: Phone number to call when the recipient taps the button. E.164 formatted. Variables are not supported.

Content creation request

content-creation-request page anchor
create-twilio-carousel-content-template page anchor
curl

_85
curl -X POST 'https://content.twilio.com/v1/Content' \
_85
-H 'Content-Type: application/json' \
_85
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \
_85
-d '{
_85
"friendly_name": "twilio_deal",
_85
"language": "en",
_85
"variables": {
_85
"1": "Twilio"
_85
},
_85
"types": {
_85
"twilio/carousel": {
_85
"body": "New {{1}} merch just dropped! 👀",
_85
"cards": [
_85
{
_85
"title":"Twilio Hoodie",
_85
"body":"Warm as owl feathers.",
_85
"media":"https://sienna-grasshopper-3262.twil.io/assets/hoodie.jpeg",
_85
"actions":[
_85
{
_85
"type":"QUICK_REPLY",
_85
"title":"I want it!",
_85
"id":"want_hoodie"
_85
},
_85
{
_85
"type":"URL",
_85
"title":"I am taking this!",
_85
"url":"https://sienna-grasshopper-3262.twil.io/assets/hoodie.jpeg"
_85
}
_85
]
_85
},
_85
{
_85
"title":"Twilio Tote",
_85
"body":"Carry a little more.",
_85
"media":"https://sienna-grasshopper-3262.twil.io/assets/tote.jpeg",
_85
"actions":[
_85
{
_85
"type":"QUICK_REPLY",
_85
"title":"I want it!",
_85
"id":"want_tote"
_85
},
_85
{
_85
"type":"URL",
_85
"title":"Take the tote!",
_85
"url":"https://sienna-grasshopper-3262.twil.io/assets/tote.jpeg"
_85
}
_85
]
_85
},
_85
{
_85
"title":"Twilio Bucket Hat",
_85
"body":"Stay in the shade.",
_85
"media":"https://sienna-grasshopper-3262.twil.io/assets/hat.jpeg",
_85
"actions":[
_85
{
_85
"type":"QUICK_REPLY",
_85
"title":"I want it!",
_85
"id":"want_hat"
_85
},
_85
{
_85
"type":"URL",
_85
"title":"Hand me the hat!",
_85
"url":"https://sienna-grasshopper-3262.twil.io/assets/hat.jpeg"
_85
}
_85
]
_85
},
_85
{
_85
"title":"Twilio Mug",
_85
"body":"Sip a little.",
_85
"media":"https://sienna-grasshopper-3262.twil.io/assets/mug.jpeg",
_85
"actions":[
_85
{
_85
"type":"QUICK_REPLY",
_85
"title":"I want it!",
_85
"id":"want_mug"
_85
},
_85
{
_85
"type":"URL",
_85
"title":"Make me a mug!",
_85
"url":"https://sienna-grasshopper-3262.twil.io/assets/mug.jpeg"
_85
}
_85
]
_85
}
_85
]
_85
}
_85
}
_85
}'

Output

_95
{
_95
"account_sid": "ACXXXXXXXX",
_95
"date_created": "2024-07-24T20:35:59Z",
_95
"date_updated": "2024-07-24T20:35:59Z",
_95
"friendly_name": "twilio_deal",
_95
"language": "en",
_95
"links": {
_95
"approval_create": "https://content.twilio.com/v1/Content/HXxxxxxxxxx/ApprovalRequests/whatsapp",
_95
"approval_fetch": "https://content.twilio.com/v1/Content/HXxxxxxxxxx/ApprovalRequests"
_95
},
_95
"sid": "HXxxxxxxx",
_95
"types": {
_95
"twilio/carousel": {
_95
"body": "New {{1}} merch just dropped! 👀",
_95
"cards": [
_95
{
_95
"actions": [
_95
{
_95
"id": "want_hoodie",
_95
"index": 0,
_95
"title": "I want it!",
_95
"type": "QUICK_REPLY"
_95
},
_95
{
_95
"title": "I'm taking this!",
_95
"type": "URL",
_95
"url": "https://sienna-grasshopper-3262.twil.io/assets/hoodie.jpeg"
_95
}
_95
],
_95
"body": "Warm as owl feathers.",
_95
"media": "https://sienna-grasshopper-3262.twil.io/assets/hoodie.jpeg",
_95
"title": "Twilio Hoodie"
_95
},
_95
{
_95
"actions": [
_95
{
_95
"id": "want_tote",
_95
"index": 0,
_95
"title": "I want it!",
_95
"type": "QUICK_REPLY"
_95
},
_95
{
_95
"title": "Take the tote!",
_95
"type": "URL",
_95
"url": "https://sienna-grasshopper-3262.twil.io/assets/tote.jpeg"
_95
}
_95
],
_95
"body": "Carry a little more.",
_95
"media": "https://sienna-grasshopper-3262.twil.io/assets/tote.jpeg",
_95
"title": "Twilio Tote"
_95
},
_95
{
_95
"actions": [
_95
{
_95
"id": "want_hat",
_95
"index": 0,
_95
"title": "I want it!",
_95
"type": "QUICK_REPLY"
_95
},
_95
{
_95
"title": "Hand me the hat!",
_95
"type": "URL",
_95
"url": "https://sienna-grasshopper-3262.twil.io/assets/hat.jpeg"
_95
}
_95
],
_95
"body": "Stay in the shade.",
_95
"media": "https://sienna-grasshopper-3262.twil.io/assets/hat.jpeg",
_95
"title": "Twilio Bucket Hat"
_95
},
_95
{
_95
"actions": [
_95
{
_95
"id": "want_mug",
_95
"index": 0,
_95
"title": "I want it!",
_95
"type": "QUICK_REPLY"
_95
},
_95
{
_95
"title": "Make me a mug!",
_95
"type": "URL",
_95
"url": "https://sienna-grasshopper-3262.twil.io/assets/mug.jpeg"
_95
}
_95
],
_95
"body": "Sip a little.",
_95
"media": "https://sienna-grasshopper-3262.twil.io/assets/mug.jpeg",
_95
"title": "Twilio Mug"
_95
}
_95
]
_95
}
_95
},
_95
"url": "https://content.twilio.com/v1/Content/HXxxxxxxxxx",
_95
"variables": {
_95
"1": "Twilio"
_95
}
_95
}


Sending your message template

sending-your-message-template page anchor

Sending a carousel template using content templates is the same as sending other types of Content Templates. Click here to see an in-depth guide for how to send Content templates.



Rate this page: