Create a template
With this API you'll be able to submit a WhatsApp template creation request to Meta. Note that a template can not be used until Meta approves it. Typically, the templates are approved within 5 minutes from the request submission but may take up to 24 hours. This might change in the future though and we'll update accordingly. You'll have to fetch the templates from time to time to get their latest status.
POST /v1/businesses/{businessId}/create/template
Path Parameters
businessId
String
{
"entity": {
"id": "template_test",
"templates": [
{
"channel": null,
"id": "1385622408844485",
"language": {
"code": "en_US"
},
"status": "MESSAGE_TEMPLATE_STATUS_PENDING",
"createdAt": "2023-01-18T01:07:20.075195879Z",
"updatedAt": "2023-01-18T01:07:20.075195879Z",
"externalTemplate": null,
"components": [],
"templateComponents": [
{
"header": {
"media": {
"type": "TYPE_IMAGE",
"example": [
"https://uploads-ssl.webflow.com/60c6f467ba3a281e33bc3449/62bcc6414212753dc33b5c2d_312313.png"
]
}
}
},
{
"body": {
"text": {
"text": "Hi {{1}}, Welcome to Connectly. Do you want to learn more?",
"example": [
"Lorem"
]
}
}
},
{
"footer": {
"text": {
"text": "Reply 'Stop' to opt out",
"example": []
}
}
},
{
"button": {
"quickReply": {
"text": "Learn more"
}
}
},
{
"button": {
"quickReply": {
"text": "Not interested"
}
}
}
],
"rejectionReason": null
}
],
"name": "template_test3",
"category": "MARKETING",
"createdAt": null,
"updatedAt": null
}
}The payload is the message template object which consists of:
name- the name of the templatecategory - category of the template. Can be any of:
language- a language object. It only has one property calledcodeand you can see all the supported language codes heretemplate_components- a list of the components that represent the template structure
Template Components
WhatsApp templates have media size limits. To know about them visit Meta documentation
Header
Template headers have 4 types:
TYPE_IMAGE- image header. You need to specify the image URL link inexampleto increase the template approval speed
TYPE_VIDEO- video header. You need to specify the video URL link inexampleto increase the template approval speed
TYPE_DOCUMENT- document header. You need to specify the document URL link inexampleto increase the template approval speed
TYPE_TEXT- text header. If you want to specify the dynamic text content in the header you can do so like this{{1}}. ONLY ONE VARIABLE IS ALLOWED IN THE HEADER.
Body
In the body component, you specify the template's main text content.
The template body supports the variables. These are dynamic fields that can be replaced with different text values when you send out the templates. See here for information on how to send the templated messages.
If you want to specify the variable in the template body, use the following syntax:
Whenever you specify the number wrapped around the curly braces (e.g {{1}}), you indicate it is a variable.
The variables must be numerated from 1-15 For example, if you have 4 variables their numbers must be strictly increasing with each. We do not allow duplicates in the variable numbers and you can not skip the number.
Footer
The message template footer.
Button
The buttons are interactive components that you use to interact with your recipients.
You can use up to 3 buttons per template.
There are two types of buttons supported on the templates:
quickReply- when a Quick Reply button is tapped, a message containing the button text is sent in the conversation. Quick Reply buttons can trigger auto responses.url- take your customers to your website. WhatsApp automatically disapproves shortened links (eg. bit.ly). Please use the full URL and add UTM parameters if required for tracking.phoneNumber- allow your customers to call you directly.
Note that you can't have Quick Reply and Call-To-Action buttons simultaneously(up to 3 quick reply buttons OR call to action with either URL and/or phone)
Examples
Simple Template with a body and no variables
Simple Template with a body with one variable
Simple Template with a body with 4 variables
Template with an image header and body varaibles
Template with text header and body variables
Template with a document header, footer, and no variables
Template with a quick reply button
Template with a CTA button that leads to the website
we can add variable in url, e.g www.example.com/{{1}}
Template with a CTA button that starts a phone call
Carousel template
To create this carousel template:

You can use this structure:
To send that template as a WhatsApp message, see Sending a Carousel template message
Template
Below is a sample request:
If successfully accepted, the above request will return 200 with the following response:
Last updated