Rate this page:

Using Buttons In WhatsApp

What are WhatsApp buttons?

WhatsApp lets you add buttons to message templates. There are two types of buttons: Quick replies and Call to action buttons. These buttons open up many opportunities for businesses worldwide to engage with their customers on WhatsApp, one of the most popular messaging applications.

Quick replies let businesses define buttons that users can tap to respond. When a Quick reply is tapped, a message containing the button text is sent in the conversation.

Call to action buttons trigger a phone call or open a website when tapped. Please note that at this time, WhatsApp does not support deeplinks.

To use buttons, you need to submit them as part of a message template to WhatsApp. Once approved, templates containing buttons can be sent by sending the message text in your API request.

Creating templates with buttons

To use buttons, you need to submit a template that contains the buttons. Go to the Twilio console, navigate to Programmable Messaging > Senders > WhatsApp Templates, and click the New message template button. Here, you need to submit a message template containing buttons. For more information, please see Sending Notifications with Templates.


Sending templates with buttons

Once your template with buttons has been approved, you can send buttons as part of your WhatsApp messages. To send a button, send a message that contains the body of the template. The buttons are automatically appended to the message.

For example, to send the buttons shown below, you need to send a message containing just the body: “Thank you for submitting your order. To finalize your payment, please tap below to call or visit our website.” The template will be sent, including the buttons.

Call to action buttons Quick reply button

If you send a message with a body that matches two templates — one with buttons and one without — the template with buttons will be automatically chosen

Loading Code Sample...
        This message contains the body used in the approved template with buttons.

        Send a WhatsApp message with buttons

        This message contains the body used in the approved template with buttons.

        Receiving Quick Replies

        When end-users tap on one of your Quick replies, this automatically triggers a message that is sent to your business with the button text. If you have a webhook configured for incoming messages to the WhatsApp sender that the Quick reply was sent to, then you can get the text of the button tapped in the ButtonText parameter from the callback. For more information, please see Twilio’s Webhook Requests.

        Additional information

        • Message templates with buttons incur standard template charges wherever applicable.
        • Buttons are supported in Twilio Studio, Flex and Conversations API by sending a message with a text body that matches the corresponding template with buttons.
        Rate this page:

        Need some help?

        We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

        Loading Code Sample...

              Thank you for your feedback!

              Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

              Sending your feedback...
              🎉 Thank you for your feedback!
              Something went wrong. Please try again.

              Thanks for your feedback!