Skip to main content

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.

Done in the app

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​

Attributes
idstring
Template id in WhautoChat
templateobject
The template in Meta's format, as it was saved: name, language, category and components
workspaceobject

The workspace the template belongs to.

createdAt, updatedAtstring
ISO 8601 timestamps
The template object
{
"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​

GET/v1/whatsapp-templates
Query parameters
workspaceIdstring
Only templates in this workspace. Without it, templates from all your workspaces are returned.
searchTextstring
Returns templates whose name contains this text. Not case sensitive.
pageintegerdefault 1
Page number, starting at 1
limitintegerdefault 10
Results per page. Max 100; larger values are capped at 100.

200 OK: a JSON array of templates, most recently updated first.

Errors
StatusBodyWhen
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.
Request
curl "https://api.whauto.chat/v1/whatsapp-templates?workspaceId=kR4tW9pLxQ&searchText=order&limit=50" \
-H "x-api-key: $WHAUTOCHAT_API_KEY"
Response 200
[
{
"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​

POST/v1/whatsapp-templates

The workspace must have the WhatsApp Cloud API connected. Template names must be unique within a workspace, across all languages.

Body parameters
workspaceIdstringrequired
The workspace to create the template in. You can send workspace: {"id": "..."} instead.
templateobjectrequired

The 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 400 with Meta's reason.

200 OK: the template object.

Errors
StatusBodyWhen
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 reasonMeta 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.
Request
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" }
]
}
]
}
}'
Response 200
{
"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​

GET/v1/whatsapp-templates/{id}
Path parameters
idstringrequired
Template id

200 OK: the template object.

Errors
StatusBodyWhen
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.
Request
curl "https://api.whauto.chat/v1/whatsapp-templates/Tm8kD3wQeR" \
-H "x-api-key: $WHAUTOCHAT_API_KEY"
Response 200
{
"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​

DEL/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.

Path parameters
idstringrequired
Template id

200 OK: { "success": true }.

Errors
StatusBodyWhen
400{"error": ...} with Meta's reasonMeta 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.
Request
curl -X DELETE "https://api.whauto.chat/v1/whatsapp-templates/Tm8kD3wQeR" \
-H "x-api-key: $WHAUTOCHAT_API_KEY"
Response 200
{ "success": true }