WhatsApp Templates
Manage the WhatsApp message templates of a workspace. Templates belong to a location (workspace) that has WhatsApp connected.
- A new template is saved with status
PENDINGand submitted to Meta for review. Checkstatuslater, or watch it in Engage > WA Templates. - The template
namemay contain only letters, numbers and underscores; spaces become underscores. Each name must be unique in the location. componentsfollow Meta's template format: aBODYis required;HEADER,FOOTERandBUTTONSare optional.- Use the template
idfrom this API with Send WhatsApp Template Message.
API region
api.whautomate.comList WhatsApp Templates
GET
/v1/whatsapp-templatesHeaders
x-api-keystringrequiredYour Whautomate API key.
Query parameters
locationIdstringsearchTextstringlimitstringpagestringResponse 200
idstringtemplateobjectThe template as sent to Meta: name, language, category and components.
statusstringMeta review status, for example
APPROVED, PENDING or REJECTED. Only APPROVED templates can be sent.locationobjectcreatedAtstringupdatedAtstringRequest
curl -X GET "https://api.whautomate.com/v1/whatsapp-templates" \
-H "x-api-key: YOUR_API_KEY"
Response 200
[
{
"id": "string",
"template": {},
"location": {
"id": "string",
"title": "string"
},
"createdAt": "string",
"updatedAt": "string"
}
]
Get a WhatsApp Template
GET
/v1/whatsapp-templates/{templateId}Headers
x-api-keystringrequiredYour Whautomate API key.
Path parameters
templateIdstringrequiredResponse 200
idstringtemplateobjectThe template as sent to Meta: name, language, category and components.
statusstringMeta review status, for example
APPROVED, PENDING or REJECTED. Only APPROVED templates can be sent.locationobjectcreatedAtstringupdatedAtstringRequest
curl -X GET "https://api.whautomate.com/v1/whatsapp-templates/{templateId}" \
-H "x-api-key: YOUR_API_KEY"
Response 200
{
"id": "string",
"template": {},
"location": {
"id": "string",
"title": "string"
},
"createdAt": "string",
"updatedAt": "string"
}
Create a WhatsApp Template
POST
/v1/whatsapp-templatesHeaders
x-api-keystringrequiredYour Whautomate API key.
Body
locationobjectrequiredtemplateobjectrequiredResponse 200
idstringtemplateobjectThe template as sent to Meta: name, language, category and components.
statusstringMeta review status, for example
APPROVED, PENDING or REJECTED. Only APPROVED templates can be sent.locationobjectcreatedAtstringupdatedAtstringRequest
curl -X POST "https://api.whautomate.com/v1/whatsapp-templates" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"location": {
"id": "string"
},
"template": {
"name": "string",
"language": "string",
"category": "MARKETING",
"components": [
{
"type": "HEADER",
"format": "string",
"text": "string",
"example": {},
"buttons": [
{}
]
}
]
}
}'
Response 200
{
"id": "string",
"template": {},
"location": {
"id": "string",
"title": "string"
},
"createdAt": "string",
"updatedAt": "string"
}
Delete a WhatsApp Template
DEL
/v1/whatsapp-templates/{templateId}Headers
x-api-keystringrequiredYour Whautomate API key.
Path parameters
templateIdstringrequiredResponse 200
successbooleanRequest
curl -X DELETE "https://api.whautomate.com/v1/whatsapp-templates/{templateId}" \
-H "x-api-key: YOUR_API_KEY"
Response 200
{
"success": true
}
Errors
| Status | Error |
|---|---|
| 400 | template must contain name, language, category and components |
| 400 | There is an existing template with the same name, Please change the template name. |
| 401 | New templates cannot be created, Please configure your whatsApp Cloud API! (WhatsApp is not connected in that location) |
| 404 | Invalid locationId |