Create a template
Explanation
Template messages need to get approval by WhatsApp (Meta) before you can start using them.
This API will guide you on submitting a new template.
Create a Utility and Marketing template
(If you wish to create authentication template, please scroll down to the last part of this page).
Remarks
If the template body is too general, it will not be approved.
You can use variables in this way: {{1}} and {{2}} and so on (up to 10 variables). this variables can be later set by you when you send the template to your clients.
A variable can be used only once inside the body. it means that if you used {{1}} somewhere in your body, you should not use {{1}} again.
You must have a reasonable number of variables compared to the rest of the text. Usually for every variable you need at least 3 words in your body. For example: if you have 5 variables, make sure the rest of the body has at least 15 words.
It usually takes up to 1 hour for a template to change status to be approved or rejected. you can't edit a rejected template, you must submit a new one with a new name. new accounts might get approved within 24 hours for their first templates submissions.
Template name must be unique. If you delete a template, you can't use the same name for 30 days.
Template name must be lower case, English letters and numbers only. no spaces.
A template can contain more than just text. it can also have image/document/video as part of the template.
You can have up to 6000 templates in your account.
A template can contain buttons for quick actions. You can have website / call / coupon / quick reply buttons, under those limitations:
A template can have a maximum of 10 buttons of all kinds.
You can have maximum of 1 'Call' button.
You can have maximum of 2 'Website' buttons.
You can have maximum of 10 'Quick reply' buttons.
You can have a maximum of 1 'Coupon' button.
quick reply button(s) are buttons that when end user click on it, you can get the text and the ID of the button. must not contain variables, new lines, Emoji or any design symbols
call button will make a phone call from a user mobile phone to the number you requested.
website button(s) can open a website link - static link (fixed) or dynamic link (with variables).
coupon button is a code that when a user click on that button it will copy the text to their clipboard.
If you wish to create a template that you will not be able to delete it after (an important template you wish to protect against accident delete) use this as the start of the template name: "reserved_".
The body of the template can't start with a variable and can't end with a variable.
A template that is created, and not being used even once for 12 months will automatically be deleted by Meta. You will get a delete webhook notification.
Carousel template must have between 2 to 10 cards, header must be image or video and up to 2 buttons for each card. This template will be Marketing category. all cards must look the same (body, button types, variables)
Endpoint:
URL | |||||
Method | JSON via POST | ||||
Header |
|
Template setup:
Each template needs to have a name and a language.
Content | Explanation | Mandatory | Example | limit (characters) | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name | Name for your template, without spaces (use underscore instead), lower case, English only. template name must be unique | yes | website_login_new_client | 512 | ||||||||||||||||||||
language |
| yes | 1 |
Template structure:
Each template contains 4 parts:
header (media is optional).
body (mandatory).
footer (optional).
buttons (optional).
Content | Explanation | Mandatory | Number of variables allowed | Example | limit (characters) |
|---|---|---|---|---|---|
header | Header allows you to choose media to be sent as part of the template 1 - no media 2 - image 3 - video 4 - document 5 - carousel | yes | 0 | 1 | 1 |
body | Your template message goes here \n for new line text for bold text for italic ~ {{1}} - {{10}} for variables | yes | 10 | Hello {{1}}, and welcome to our website! thank you for buying {{2}}. your order will be shipped on {{3}}. | 1024 for total body content, including the variables data when sending the template |
bodyVariableSample1-10 | For any given variable you used in "body", you can provide a sample text for example. for {{1}} use bodyVariableSample1 for {{2}} use bodyVariableSample2 and so on | No, but if not provided, auto variable sample will be generated for you | 0 | This is a sample text | 500 |
footer | Any footer you want to add. no Emoji use, no variables. footer does not work for carousel header. | no | 0 | This is footer, optional | 60 |
buttons | 1 - No buttons 2 - for "call to action" only 3 - for "quick reply" only 4 - both call to action and quick reply combination | yes. you must select 1/2/3/4 | see below | see below | 1 |
carouselMedia | Only relevant if "header" is set to 5. You must choose the carousel cards either an image for all cards, or video for all cards. 1 - image cards 2 - video cards | yes, if header = 5. | 1 | 1 | 1 |
carouselButtons | Only relevant if "header" is set to 6. buttons setup: 1 - one website only. 2 - one quick reply only. 3 - two quick reply only. 4 - website + quick reply. 5 - phone + website. 6 - phone + quick reply only. | yes, if header = 5 | 0 | 3 | 1 |
For the 'body' part, you can also use the following markups:

Buttons setup:
if you wish to use buttons, you need to choose between "call to action" or "quick reply" or using both.
call to action is a button that triggers an action. we have two types: url (which triggers website open with the phone's browser) and call (which makes a regular phone call to a number). you can use up to 1 call button and 2 website buttons in your template.
quick reply is a button that allows the user to click on it and return back webhook about the button text that was clicked. for example, a button name "sales" will return to your webhook url a reply saying that "sales" was clicked, so you can build your flow scenario according to that. you can have up to 10 buttons of quick reply type.
remember! total of 10 buttons is allowed from the two kinds.
Content | Explain | Option to select | Mandatory | Number of variables allowed | Example | Limit (characters) |
|---|---|---|---|---|---|---|
callToAction | Here you can choose how you want to setup the call to action | 1 - One website button only 2 - Call button only 3 - One website + Call button 4 - Two websites + Call button 5 - Two websites only | only if you selected "2" or "4" on "buttons" | - | 3 | 1 |
callToActionWebsiteText | First website text to show | text to show for the link | only if you used 'callToAction' option 1 / 3 / 4 / 5 | 0 | Click here for my website | 20 |
callToActionWebsiteType | First website link type | 1 - for static URL (meaning, no variable) 2 - for dynamic with one variable automatically added at the end of the URL | only if you used 'callToAction' option 1 / 3 / 4 / 5 | 0 | 1 | 1 |
callToActionWebsiteURL | First website link URL | The link to your website, you cannot use WhatsApp's groups, WhatsApp URL's for opening a conversation, and cannot use short URL services such as bitly. | only if you used 'callToAction' option 1 / 3 / 4 / 5 | In case you choose "2" at the callToActionWebsiteType. the variable will be automatically put at the end. for example: so when you send the template, you can provide what the {{1}} will be | 2000 | |
callToActionWebsiteText2 | Second website text to show, in case you want to use second website button. | text to show for the link | only if you used 'callToAction' option 4 / 5 | 0 | Click here for my second website | 20 |
callToActionWebsiteType2 | Second website link type | 1 - for static URL (meaning, no variable) 2 - for dynamic with one variable automatically added at the end of the URL | only if you used 'callToAction' option 4 / 5 | 0 | 1 | 1 |
callToActionWebsiteURL2 | Second website link URL | The link to your website, you cannot use WhatsApp's groups, WhatsApp URL's for opening a conversation, and cannot use short URL services such as bitly. | only if you used 'callToAction' option 4 / 5 | in case you choose "2" at the callToActionWebsiteType2. the variable will be automatically put at the end. for example: so when you send the template, you can provide what the {{1}} will be | 2000 | |
callToActionCallText | The button text for the call | The text to show for the dial button | only if you used 'callToAction' option 2 / 3 / 4 | 0 | Click here to call me | 20 |
callToActionCallNumber | The number to dial to. the number is fixed. | the number to dial, with country code and + | only if you used 'callToAction' option 2 / 3 / 4 | 0 | +972501234567 | 20 |
useCoupon | A coupon button is another type of "Call To Action" and can be added to any of the "callToAction" 1/3/4/5 options. when using coupon button the end user will receive copy code coupon message that can have expiration time. if coupon code button is used, please notice the following limitations:
| 0 to disable 1 to enable | no. default is 0. | 0 | 1 | 1 |
couponTitle | The title of the coupon code that will be present next to the code in the template. | text to show for the coupon title | only if useCoupon is set to 1 | 0 | Special offer! | 16 |
couponExpiration | In case you want to use time limit for the coupon button. you will provide the expiration time when sending the template. | 0 - to have a coupon without time limit. 1 - to limit the time to use the coupon. | only if useCoupon is set to 1 | 0 | 1 | 1 |
quickReply1-10 | the quick reply buttons. up to 10 buttons | provide quickReply buttons as parameters (quickReply1, quickReply2, etc...) | Only if you selected 'buttons' parameter as 3 or 4 | 0 | "customer service" "sales" "support" | 25 |
carouselCardX_body | In case the header is carousel, here is the body of card number X X from 1 to 10 | The body text of the specific carousel body | No, but its all or none. if you choose to have a card for one item, all of them must have. | 1 | Here is my first product, named: {{1}}. click to buy | 160 |
carouselCardX_websiteText | In case carouselButtons is set to 1/4/5 where X can be between 1 to 10 | Text to show for the website button | Only if carouselButtons is 1/4/5 | 0 | Click here | 25 |
carouselCardX_websiteType | In case carouselButtons is set to 1/4/5 where X can be between 1 to 10 | 1 - for static website url. 2 - for dynamic , with variable at the end. | Only if carouselButtons is 1/4/5 | 1 | 1 | 1 |
carouselCardX_websiteURL | In case carouselButtons is set to 1/4/5 where X can be between 1 to 10 | This is the website URL, you can use variable that will be added at the end. | Only if carouselButtons is 1/4/5 | in case you choose "2" at the carouselCardX_websiteURL. the variable will be automatically put at the end. for example: so when you send the template, you can provide what the {{1}} will be. | https://www.amazon.com/ | 2000 |
carouselCardX_quickReply1 | In case carouselButtons is set to 2/3/4/6 Where x can be between 1 to 10 | This is the first quick reply button | Only if carouselButtons is 2/3/4/6 | 0 | Click Here | 25 |
carouselCardX_quickReply2 | In case carouselButtons is set to 3 Where x can be between 1 to 10 | This is the second quick reply button | Only if carouselButtons is 3 | 0 | Click here 2 | 25 |
carouselCardX_callText | In case carouselButtons is set to 5/6 Where x can be between 1 to 10 | This is the button text for the phone call | Only if carouselButtons is 5/6 | 0 | Call now | 25 |
carouselCardX_callNumber | In case carouselButtons is set to 5/6 Where x can be between 1 to 10 | This is the phone number | Only if carouselButtons is 5/6, and carouselCardX_callText is provided | 0 | +972501234567 | 20 |
Full Request
Parameter | Description / Example |
from | your WhatsApp account. international number without +. for example: 972771234567 |
name | any name for the template, cannot be used twice |
language | 1-10 |
header | 2 for image |
body | your template + variables goes here \n for new line text for bold text for italic ~ {{1}} for variable 1 {{2}} for variable 2 and so on (maximum 10 variables) |
footer | footer text |
buttons | 3 for quick reply |
callToAction | all what is relevant to buttons (phone calls, website(s), coupon code) |
quickReply1-10 | any text goes here |
Full example 1:
here is an example of full template request. the request template is in English.
The template contains:
no header.
body with 6 variables.
no footer.
2 websites, 1 call button.
5 buttons of "quick reply".
{
"from": "972501234567",
"name": "website_welcome",
"language": 2,
"header": 1,
"body": "*Hello {{1}}* and thank you for joining our exclusive website store!\nOur company has many secrets to discover.\nFor future connection, we received your phone number: {{2}} and your email address: {{3}}.\nYou can find shirts, hats, shoes and gloves at discounted prices. Hold on, wait a minute, i found something interesting! just for this week we offer: {{4}} at discounted price: {{5}} only when you buy it online or in-store shop at: {{6}}.\nWhat would you like to discover?",
"buttons": 4,
"callToAction": 4,
"callToActionWebsiteText": "Our Website",
"callToActionWebsiteType": 1,
"callToActionWebsiteURL": "https://www.example.com",
"callToActionWebsiteText2": "Our second website",
"callToActionWebsiteType2": 1,
"callToActionWebsiteURL2": "https://www.example-second-website.com",
"callToActionCallText": "Click to call us",
"callToActionCallNumber": "+972522222222",
"quickReply1": "Shirts",
"quickReply2": "Hats",
"quickReply3": "Shoes",
"quickReply4": "Gloves",
"quickReply5": "Something else"
}
The template submission will look like this:

When you send the template to your client, you need to fill the {{1}}, {{2}}, {{3}}, {{4}}, {{5}} and {{6}}.
Full example 2:
here is a sample of full template request. the request is appointment update template, in English.
the template contains:
image header
body with 2 variables
footer
buttons: call to action (one website + one call button)
{
"from": "972501234567",
"name": "friday_appointment_reminder",
"language": 2,
"header": 2,
"body": "*Hello {{1}}* we would like to remind you for the appointment you have with us on {{2}}. \n please arrive with your ID card.",
"footer": "Our address: 51D street.",
"buttons": 2,
"callToAction": 3,
"callToActionWebsiteText": "Click for navigation",
"callToActionWebsiteType": 1,
"callToActionWebsiteURL": "https://waze.com/ul",
"callToActionCallText": "Call Us",
"callToActionCallNumber": "+972779111111"
}
The template submission will look like this:

Full example 3:
here is a sample of full template request. the request is payment update template, in English.
the template contains:
document header
body with 2 variables
no footer
buttons: call to action (dynamic website)
{
"from": "972501234567",
"name": "payment_reminder_1",
"language": 2,
"header": 4,
"body": "*Dear {{1}}*\n your invoice for December 2021 is attached. Total amount is {{2}} USD. \n Please pay as soon as you can. \n The invoice is due in a week. 💳",
"buttons": 2,
"callToAction": 1,
"callToActionWebsiteText": "Click to pay",
"callToActionWebsiteType": 2,
"callToActionWebsiteURL": "https://paypal.com/"
}
The template submission will look like this:

Full example 4:
here is a sample of full template request. the request is transportation update template, in English.
the template contains:
no header
body with no variables
footer
no buttons
{
"from": "972501234567",
"name": "the_bus_is_coming",
"language": 2,
"header": 1,
"body": "*Dear NetBus user*\n Your bus is on its way. \n stay sharp. 🚍🚍🚍🚍",
"footer": "The wheels on the bus go round and round",
"buttons": 1
}
The template submission will look like this:

Full example 5:
here is a sample of full template request in English. the request is weekend sale with coupon code
the template contains:
no header
body with 2 variables
1 website button (static website)
1 phone button
1 coupon code button with expiration time.
{
"from": "972501234567",
"name": "weekend_sale",
"language": 2,
"header": 1,
"body": "*Hello {{1}}*\n We value our VIP clients very much and would like to offer you {{2}} off for the weekend sale only!",
"buttons": 2,
"callToAction": 3,
"callToActionWebsiteText": "Click here for more",
"callToActionWebsiteType": 1,
"callToActionWebsiteURL": "https://www.amazon.com/store/",
"callToActionCallText": "Call Us",
"callToActionCallNumber": "+9725011223344",
"useCoupon": 1,
"couponTitle": "Weekend Sale!",
"couponExpiration": 1
}
The template submission will look like this:

(The 'Copy offer code' text is fixed and can't be changed, each template language will show the relevant translation. when the user clicks on it, it will copy the code. when sending the template, the expiration will show the relevant timer).
Response:
{
"status": "OK",
"name": "template name",
"timestamp": 1710861707,
"body": "The body text you wrote",
"category": 1,
"reason": 1
}Full example 6:
Here is a sample of full carousel template in english.
Image cards
3 cards with variable
Each card has 1 static website and 1 quick reply button
This is how it will look like, client can switch to the 3 cards provided

{
"from": "972501234567",
"name": "carousel_1",
"language": 2,
"header": 5,
"carouselMedia": 1,
"carouselButtons": 4,
"body": "Hello! see all my cards below",
"carouselCard1_body": "Card 1 body text",
"carouselCard1_websiteText": "My website",
"carouselCard1_websiteType": 1,
"carouselCard1_websiteURL": "https://www.amazon.com",
"carouselCard1_quickReply1": "Contact us",
"carouselCard2_body": "Card 2 body text",
"carouselCard2_websiteText": "My website 2",
"carouselCard2_websiteType": 1,
"carouselCard2_websiteURL": "https://www.google.com",
"carouselCard2_quickReply1": "Contact us 2",
"carouselCard3_body": "Card 2 body text",
"carouselCard3_websiteText": "My website 2",
"carouselCard3_websiteType": 1,
"carouselCard3_websiteURL": "https://www.wikipedia.com",
"carouselCard3_quickReply1": "Contact us 3"
}Response:
{
"status": "OK",
"name": "carousel_1",
"timestamp": 1788784106,
"body": "Hello! see all my cards below",
"category": 2,
"reason": 1
}Response-Explain:
Parameter | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
status | OK (template submitted to Meta) or FAIL (template error) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name | The template name you submitted | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
timestamp | The timestamp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
body | the body message you submitted | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
category | The temporarily category that Meta selected for the template.
The reason its 'temporarily' is because until the template is approved, the category can be changed by Meta. The final and actual category is determined when the template is approved and can be abtained by the 'Get template' api. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
reason | 'reason' is the status explanation in case of FAIL
|
Create an Authentication template
Authentication code template is a different kind of template you can create.
It is still a template, but its different than the regular template creation and it doesn't contain the normal structure: header,body,footer,buttons.
Authentication code template is OTP, one time password code that you can send to your clients over WhatsApp. it looks like this:

Remarks
The template text is fixed and can't be changed (per language).
The "Copy code" button is fixed and can't be changed (per language).
The template will have "copy code" that will copy the code from WhatsApp for easy usage.
You can only create authentication template is your daily limit is 1000 or more.
The authentication template , when sending it, can only be visible from a mobile phone. if the WhatsApp Web is used by your client, the template message with the code will not be visible for him.
Endpoint (same as regular template creation):
URL | |||||
Method | JSON via POST | ||||
Header |
|
Body:
Each template needs to have a name and a language.
Content | Explanation | Mandatory | Example | limit (characters) | Explanation | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
from | Your WhatsApp account number | Yes | |||||||||||||||||||||||
name | Name for your template, without spaces (use underscore instead), lower case, English only. template name must be unique | yes | login_code | 512 | |||||||||||||||||||||
language |
| yes | 1 | ||||||||||||||||||||||
authentication | 1 (fixed, always) | yes | 1 | 1 | This is for our system to know you are building an authentication template | ||||||||||||||||||||
add_security_text | 0 - no security message 1 - with security message (default is 0) | No | 1 | 1 | This is a fixed text along with your code. as in the above screenshot, the text "For your security, do not share this code." will be added (based on your template language) | ||||||||||||||||||||
code_expiration | 0-90 minutes for code expiration (default is 0 - no expiration) | no | 5 | 2 | If you wish your code to expire, you can provide the code expiration in minutes between 1 to 90. when the time is up, the "copy code" button will not be available and the text "the code has expired" will be instead. |
Response:
"status": "OK",
"name": "template name",
"timestamp": 1710861707,
"category": 3,
"reason": 1
Response-Explain:
Parameter | Description | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
status | OK (template submitted to Meta) or FAIL (template error) | ||||||||||||||
name | The template name you submitted | ||||||||||||||
timestamp | The timestamp | ||||||||||||||
category | The temporarily category.
| ||||||||||||||
reason | 'reason' is the status explanation in case of FAIL
|