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

Rich Messaging Features in the Twilio API for WhatsApp


Twilio supports the latest WhatsApp-specific features to make it easier for your customers to engage with you.


Rich outbound messages with Content Template Builder

rich-outbound-messages-with-content-template-builder page anchor

WhatsApp's latest rich features are supported using Twilio's Content Template Builder.

These features include:

  • Formatting message text
  • Messages including location information
  • Card messages with images, text, and/or buttons
  • List messages
  • Call-to-action messages
  • Messages with quick reply buttons

Rich Inbound Features in Webhooks

rich-inbound-features-in-webhooks page anchor

Twilio supports the latest inbound metadata made available by WhatsApp. This includes the end user's profile name, click to WhatsApp ad parameters, and much more.

See our request to your webhook URL for all of the supported inbound parameters for rich messages.


Formatting in WhatsApp Messages

formatting-in-whatsapp-messages page anchor

WhatsApp allows text, emojis, and some formatting in messages. To format all or part of a message, use these formatting symbols:

FormattingSymbolExample
BoldAsterisk (**)Your total is $10.50.
ItalicUnderscore (_)Welcome to WhatsApp!
Strike-throughTilde (~)This is better best!
Code / Pre-formattedThree backticks (```)print 'Hello World';

Send a formatted WhatsApp message

send-a-formatted-whatsapp-message page anchor

Use symbols to format your WhatsApp messaage

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_15
// Download the helper library from https://www.twilio.com/docs/node/install
_15
// Find your Account SID and Auth Token at twilio.com/console
_15
// and set the environment variables. See http://twil.io/secure
_15
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_15
const authToken = process.env.TWILIO_AUTH_TOKEN;
_15
const client = require('twilio')(accountSid, authToken);
_15
_15
client.messages
_15
.create({
_15
from: 'whatsapp:+15005550006',
_15
messagingServiceSid: 'MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
_15
body: '🎶I am _not_ ~pushing~ throwing away my *shot*!',
_15
to: '+15558675310'
_15
})
_15
.then(message => console.log(message.sid));

Output

_24
{
_24
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"api_version": "2010-04-01",
_24
"body": "🎶I am _not_ ~pushing~ throwing away my *shot*!",
_24
"date_created": "Thu, 24 Aug 2023 05:01:45 +0000",
_24
"date_sent": "Thu, 24 Aug 2023 05:01:45 +0000",
_24
"date_updated": "Thu, 24 Aug 2023 05:01:45 +0000",
_24
"direction": "outbound-api",
_24
"error_code": null,
_24
"error_message": null,
_24
"from": "whatsapp:+15005550006",
_24
"num_media": "0",
_24
"num_segments": "1",
_24
"price": null,
_24
"price_unit": null,
_24
"messaging_service_sid": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"sid": "SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"status": "queued",
_24
"subresource_uris": {
_24
"media": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Media.json"
_24
},
_24
"to": "+14155552345",
_24
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_24
}

WhatsApp message displaying italics, strike-through, and bolding.Rate this page:

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.