Template Elements
Templates can include text, media, and interactive elements, and can be managed through the Messaging API and WhatsApp Manager.
Variables
Any template that has one or more variables requires a sample in order to be submitted for review. Samples can be added by including the example property in the API request.
For example:
{
"name": "sample",
"category": "UTILITY",
"components": [
{
"format": "TEXT",
"text": "New request",
"type": "HEADER"
},
{
"type": "BODY",
"text": "Hi {{1}}, thanks for getting in touch with {{2}}. We will process your request get back to you shortly",
"example": {
"body_text": [
"Emilia",
"360dialog"
]
}
},
{
"text": "WhatsApp Business Platform provided by 360Dialog",
"type": "FOOTER"
}
],
"language": "en_US"
}Named Variables
Examples shown in this page use positional variables like {{1}}, {{2}}, {{3}}. Examples for positional variables are provided in an array like:
where "Emilia" corresponds to {{1}}, and "360dialog" corresponds to {{2}}.
Named variables can be used instead of positional variables depending on preference. Named variables look like {{customer_first_name}}, {{company_name}}. Examples for named variables are provided in an dictionary/object like:
To use named variables, add _named_params at the end of the example object's keys (e.g. body_text becomes body_text_named_params; or header_text becomes header_text_named_params.) Provide an example for each named variable inside a dictionary.
Components
Headers
Headers are optional components that appear at the top of template messages. Headers support text, media (images, videos, documents), and locations. Templates are limited to one header component.
Text Headers
Syntax
Properties
<HEADER_TEXT>
Sample header text.
Summer Sale
<TEXT>
Text to appear in template header when sent. Supports 1 variable.
If the string contains a variable, you must include the example property and a sample variable value.
60 characters maximum.
Our {{1}} is on!
Example
Media Headers
Media headers can be an image, video, or a document such as a PDF. The syntax for defining a media header is the same for all media types.
Syntax
Properties
<FORMAT>
Indicates media asset type. Set to IMAGE, VIDEO, or DOCUMENT.
IMAGE
<URL>
Link to a file
https://www.gstatic.com/webp/gallery/1.jpg
Example
Location Headers
Location headers appear as generic maps at the top of the template and are useful for order tracking, delivery updates, ride hailing pickup/dropoff, locating physical stores, etc. When tapped, the app user's default map app will open and load the specified location.
Location headers can only be used in templates categorized as UTILITY or MARKETING. Real-time locations are not supported.
Syntax
Properties
Property values cannot be customized.
Example
Body
Body components are text-only components and are required by all templates. Templates are limited to one body component.
Syntax
Properties
<BODY_TEXT>
Array of sample strings. Number of strings must match the number of variables included in the string.
"the end of August","25OFF","25%"
<TEXT>
Text string. Supports multiple variables.
If the string contains variables, you must include the example property and sample variable values.
1024 characters maximum.
Shop now through {{1}} and use code {{2}} to get {{3}} off of all merchandise.
Example
Footer
Footers are optional text-only components that appear immediately after the body component. Templates are limited to one footer component.
Syntax
Properties
<TEXT>
Text to appear in template footer when sent.
60 characters maximum.
Use the buttons below to manage your marketing subscriptions
Example
Buttons
Buttons are optional interactive components that perform specific actions when tapped. Templates can have a mixture of up to 10 button components total, although there are limits to individual buttons of the same type as well as combination limits.
These limits are described below:
Quick Reply, Quick Reply
Quick Reply, Quick Reply, URL, Phone
URL, Phone, Quick Reply, Quick Reply
Quick Reply, URL, Quick Reply
URL, Quick Reply, URL
Buttons are defined within a single buttons component object, packed into a single buttons array. For example, this template uses a phone number button and a URL button:
If a template has more than three buttons, two buttons will appear in the delivered message and the remaining buttons will be replaced with a See all options button. Tapping the See all options button reveals the remaining buttons.

Phone number Buttons
Phone number buttons call the specified business phone number when tapped by the app user. Templates are limited to one phone number button.
Syntax
Properties
<PHONE_NUMBER>
Alphanumeric string.
Business phone number to be (display phone number) called when the user taps the button.
20 characters maximum.
15550051310
<TEXT>
Button label text.
25 characters maximum.
Call
Example
URL Buttons
URL buttons load the specified URL in the device's default web browser when tapped by the app user. Templates are limited to two URL buttons.
If you include a button with a variable that is a URL, it must be URL-encoded.
Syntax
Properties
<EXAMPLE>
URL of website. Supports 1 variable.
If using a variable, add sample variable property to the end of the URL string. The URL loads in the device's default mobile web browser when the customer taps the button.
2000 characters maximum.
https://www.luckyshrub.com/shop?promo=summer2023
The API does not accept Cyrillic characters in URLs within button elements. Please ensure your URLs contain only Latin characters.
<TEXT>
Button label text. Supports 1 variable.
If using a variable, must include the example property and a sample value.
25 characters maximum.
Shop Now
<URL>
URL of website that loads in the device's default mobile web browser when the button is tapped by the app user.
Supports 1 variable, appended to the end of the URL string.
2000 characters maximum.
https://www.luckyshrub.com/shop?promo={{1}}
The API does not accept Cyrillic characters in URLs within button elements. Please ensure your URLs contain only Latin characters.
Example
Example Request - Limited Time Offer
An example request to create a marketing template with the following components:
an image header with a sample value
a text body with variables and sample values
a text footer
a phone number button
a URL button
URL Buttons with Deep Links
An Android deep link can be mapped to a marketing template URL button that, when tapped, loads a particular location or content within the app.
Syntax
Properties
<ANDOROID_DEEP_LINK>
Required. Android deep link URI.
https://www.luckyshrub.com/summer_solstice
<TEXT>
Required. Button label text. Maximum 25 characters.
View deal
<ANDROID_FALLBACK_URL>
Optional. Fallback URL. If the WhatsApp client cannot load the deep link URI, the client will load this URL in the device’s default web browser.
https://www.luckyshrub.com/summer_solstice
<META_APP_ID>
Required. This is a list of the Meta app(s) associated with your business portfolio. Select the app whose access token you will use to send the template.
Lucky Shrub (634974688087057)
<TYPE_OF_ACTION>
Required. Must be set to Visit website.
Visit website
<URL_TYPE>
Required. Set to Static if your Android deep link or Android fallback URL has no dynamic values, otherwise set to Dynamic.
Static
<WEBSITE_URL>
Required.URL of a website to load if the WhatsApp user views the message on a non-Android device, or if the WhatsApp client cannot load your Android deep link URI and no Android fallback URL is specified
https://www.luckyshrub.com/
Example

Example Request
An example request to create a marketing template with the Deep Link URL button.
SPM Buttons
Single-product message (SPM) buttons are specific, non-customizable buttons that can be mapped to a product in your product catalog. When tapped, they load details about the product, which it pulls from your catalog. Users can then add the product a card and place an order. See Single-Product Message Templates and Product Card Carousel Templates.
Quick Reply Buttons
Quick reply buttons are custom text-only buttons that immediately message you with the specified text string when tapped by the app user. A common use case-case is a button that allows your customer to easily opt-out of any marketing messages.
Templates are limited to 10 quick reply buttons. If using quick reply buttons with other buttons, buttons must be organized into two groups: quick reply buttons and non-quick reply buttons. If grouped incorrectly, the API will return an error indicating an invalid combination.
Examples of valid groupings:
Quick Reply, Quick Reply
Quick Reply, Quick Reply, URL, Phone
URL, Phone, Quick Reply, Quick Reply
Examples of invalid groupings:
Quick Reply, URL, Quick Reply
URL, Quick Reply, URL
To send a template that has multiple quick reply buttons, you can use the index property to designate the order in which buttons appear in the template message.
Syntax
Properties
<TEXT>
Button label text.
25 characters maximum.
Unsubscribe
Example
Example Request - Seasonal Promotion
An example request to create a marketing template with the following components:
a text header with a variable and sample value
a text body with variables and sample values
a text footer
two quick-reply buttons
Copy Code Buttons
Copy code buttons copy a text string (defined when the template is sent in a template message) to the device's clipboard when tapped by the app user. Templates are limited to one copy code button.
Syntax
Properties
<EXAMPLE>
String to be copied to device's clipboard when tapped by the app user.
Maximum 15 characters.
250FF
Example
OTP Buttons
One-time password (OTP) buttons are a special type of URL button used with authentication templates. See Authentication Templates.
Flows Buttons
Flows buttons are for sending Flows Messages as templates. Templates are limited to one Flows button.
Syntax
Properties
<TEXT>
Button label text.
25 characters maximum.
Sign up
<FLOW_ID>
Unique identifier of the Flow provided by WhatsApp. The Flow must be published.
123456789012345
<FLOW_ACTION>
navigate or data_exchange. Use navigate to predefine the first screen as part of the template message. Use data_exchange for advanced use-cases where the first screen is provided by your endpoint.
Default: navigate
navigate
<NAVIGATE_SCREEN>
Required only if flow_action is navigate. The id of the first screen of the Flow.
flow_json_first_screen
Example
Last updated
Was this helpful?