WhatsApp templates
Outside the 24-hour customer service window WhatsApp only delivers approved templates. Use this API to create templates from your own systems, find a template to send with the Messages API, or clean up ones you no longer use. A template you create is submitted to Meta straight away, and Meta decides whether to approve it.
Editing a template, and checking whether Meta has approved it, is done in the app, not the API. Responses don't include Meta's approval status, so check it in the app before you send a template.
The template object
idstringtemplateobjectname, language, category and componentsworkspaceobjectThe workspace the template belongs to.
createdAt, updatedAtstring{
"id": "Tm8kD3wQeR",
"template": {
"name": "order_shipped",
"language": "en_US",
"category": "UTILITY",
"components": [
{
"type": "BODY",
"text": "Hi {{1}}, your order {{2}} has shipped and will arrive on {{3}}.",
"example": { "body_text": [["Maria", "A-10482", "18 October"]] }
},
{ "type": "FOOTER", "text": "Lopez Dental Studio" },
{
"type": "BUTTONS",
"buttons": [
{ "type": "URL", "text": "Track order", "url": "https://shop.example.com/track" }
]
}
]
},
"workspace": {
"id": "kR4tW9pLxQ",
"title": "Downtown Clinic"
},
"createdAt": "2026-10-14T09:30:12.204Z",
"updatedAt": "2026-10-14T09:30:12.204Z"
}
List templates
/v1/whatsapp-templatesworkspaceIdstringsearchTextstringpageintegerdefault 1limitintegerdefault 10100; larger values are capped at 100.200 OK: a JSON array of templates, most recently updated first.
Errors
| Status | Body | When |
|---|---|---|
401 | {"message":"Unauthorized"} | The x-api-key header is missing, invalid or the key was deleted |
404 | {"error":"Invalid workspaceId"} | No workspace with that id in your account |
500 | {"error":"Could not retrieve WhatsApp Templates"} | Something went wrong on our side. Retry, and contact support if it continues. |
curl "https://api.whauto.chat/v1/whatsapp-templates?workspaceId=kR4tW9pLxQ&searchText=order&limit=50" \
-H "x-api-key: $WHAUTOCHAT_API_KEY"
[
{
"id": "Tm8kD3wQeR",
"template": {
"name": "order_shipped",
"language": "en_US",
"category": "UTILITY",
"components": [
{ "type": "BODY", "text": "Hi {{1}}, your order {{2}} has shipped and will arrive on {{3}}.", "example": { "body_text": [["Maria", "A-10482", "18 October"]] } },
{ "type": "FOOTER", "text": "Lopez Dental Studio" }
]
},
"workspace": { "id": "kR4tW9pLxQ", "title": "Downtown Clinic" },
"createdAt": "2026-10-14T09:30:12.204Z",
"updatedAt": "2026-10-14T09:30:12.204Z"
}
]
Create a template
/v1/whatsapp-templatesThe workspace must have the WhatsApp Cloud API connected. Template names must be unique within a workspace, across all languages.
workspaceIdstringrequiredworkspace: {"id": "..."} instead.templateobjectrequiredThe template in Meta's message template format. It is sent to Meta exactly as you send it.
About the name: WhautoChat trims it and turns spaces into underscores before checking it, and rejects anything other than letters, numbers and underscores. It stores that cleaned name, but the template object goes to Meta unchanged, so send a name that is already valid (for example order_shipped, not Order Shipped).
How submission works:
- If your WhatsApp Business account already has a template with the same name and language, WhautoChat links to it instead of submitting a new one.
- If Meta rejects the submission (for example, a missing example value or an invalid name), nothing is saved and you get
400with Meta's reason.
200 OK: the template object.
Errors
| Status | Body | When |
|---|---|---|
400 | {"error":"template is required"} | No template object |
400 | {"error":"template must contain name, language, category and components"} | One of those four fields is missing |
400 | {"error":"Invalid template name. Only letters, numbers, and underscores are allowed. Spaces will be converted to underscores."} | The name has other characters |
400 | {"error":"workspaceId is required"} | No workspaceId or workspace.id |
400 | {"error":"There is an existing template with the same name, Please change the template name."} | The workspace already has a template with that name |
400 | {"error": ...} with Meta's reason | Meta rejected the submission |
401 | {"message":"Unauthorized"} | The x-api-key header is missing, invalid or the key was deleted |
401 | {"error":"New templates cannot be created, Please configure your whatsApp Cloud API!"} | The workspace does not have the WhatsApp Cloud API connected. Connect it in the app. |
404 | {"error":"Invalid workspaceId"} | No workspace with that id in your account |
500 | {"error":"Could not create WhatsApp Template"} | Something went wrong on our side. Retry, and contact support if it continues. |
curl -X POST "https://api.whauto.chat/v1/whatsapp-templates" \
-H "x-api-key: $WHAUTOCHAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workspaceId": "kR4tW9pLxQ",
"template": {
"name": "order_shipped",
"language": "en_US",
"category": "UTILITY",
"components": [
{
"type": "BODY",
"text": "Hi {{1}}, your order {{2}} has shipped and will arrive on {{3}}.",
"example": {
"body_text": [["Maria", "A-10482", "18 October"]]
}
},
{
"type": "FOOTER",
"text": "Lopez Dental Studio"
},
{
"type": "BUTTONS",
"buttons": [
{ "type": "URL", "text": "Track order", "url": "https://shop.example.com/track" }
]
}
]
}
}'
{
"id": "Tm8kD3wQeR",
"template": {
"name": "order_shipped",
"language": "en_US",
"category": "UTILITY",
"components": [
{
"type": "BODY",
"text": "Hi {{1}}, your order {{2}} has shipped and will arrive on {{3}}.",
"example": { "body_text": [["Maria", "A-10482", "18 October"]] }
},
{ "type": "FOOTER", "text": "Lopez Dental Studio" },
{
"type": "BUTTONS",
"buttons": [
{ "type": "URL", "text": "Track order", "url": "https://shop.example.com/track" }
]
}
]
},
"workspace": {
"id": "kR4tW9pLxQ",
"title": "Downtown Clinic"
},
"createdAt": "2026-10-14T09:30:12.204Z",
"updatedAt": "2026-10-14T09:30:12.204Z"
}
Get a template
/v1/whatsapp-templates/{id}idstringrequired200 OK: the template object.
Errors
| Status | Body | When |
|---|---|---|
401 | {"message":"Unauthorized"} | The x-api-key header is missing, invalid or the key was deleted |
404 | {"error":"WhatsApp Template not found"} | No template with that id in your account |
500 | {"error":"Could not retrieve WhatsApp Template"} | Something went wrong on our side. Retry, and contact support if it continues. |
curl "https://api.whauto.chat/v1/whatsapp-templates/Tm8kD3wQeR" \
-H "x-api-key: $WHAUTOCHAT_API_KEY"
{
"id": "Tm8kD3wQeR",
"template": {
"name": "order_shipped",
"language": "en_US",
"category": "UTILITY",
"components": [
{ "type": "BODY", "text": "Hi {{1}}, your order {{2}} has shipped and will arrive on {{3}}.", "example": { "body_text": [["Maria", "A-10482", "18 October"]] } },
{ "type": "FOOTER", "text": "Lopez Dental Studio" }
]
},
"workspace": { "id": "kR4tW9pLxQ", "title": "Downtown Clinic" },
"createdAt": "2026-10-14T09:30:12.204Z",
"updatedAt": "2026-10-14T09:30:12.204Z"
}
Delete a template
/v1/whatsapp-templates/{id}Deletes the template from WhautoChat and from your WhatsApp Business account in Meta. If Meta refuses the deletion, the template is kept and you get 400 with Meta's reason. You cannot undo this.
idstringrequired200 OK: { "success": true }.
Errors
| Status | Body | When |
|---|---|---|
400 | {"error": ...} with Meta's reason | Meta refused the deletion |
401 | {"message":"Unauthorized"} | The x-api-key header is missing, invalid or the key was deleted |
404 | {"error":"WhatsApp Template not found"} | No template with that id in your account |
500 | {"error":"Could not delete WhatsApp Template"} | Something went wrong on our side. Retry, and contact support if it continues. |
curl -X DELETE "https://api.whauto.chat/v1/whatsapp-templates/Tm8kD3wQeR" \
-H "x-api-key: $WHAUTOCHAT_API_KEY"
{ "success": true }