Create a WhatsApp Business text template
Submit a new text-only UTILITY or MARKETING template to Meta for review.
- Key permissions
- Read chats and messages + Manage templates
- Authentication
Authorization: Bearer $WHATSYNC_API_KEY
How keys work
How it works
- This creates a real template on the connected Business account; Meta decides its category and approval status.
- Use
get_business_templatelater to check it. - No WhatSync approval page is involved.
Uses the Meta WhatsApp Business Management API message templates endpoint: Meta's documentation
Body parameters
idempotencyKeystringbody or headerA fresh random UUID for each new action; never build it from dates, names, counters or step numbers, which repeat across runs. Reuse it exactly only to retry the same action.
namestringrequiredLowercase template name with underscores
languagestringrequiredTemplate language, for example en_US
categoryUTILITY | MARKETINGrequiredSee the example and input schema for this value.
bodystringrequiredSee the example and input schema for this value.
bodyExamplesstring[]optionalOne sample value for each numbered body variable, in order
headerstringoptionalSee the example and input schema for this value.
footerstringoptionalSee the example and input schema for this value.
Conditions and pagination
- Use a lowercase template name with underscores and an approved language code. Supply one bodyExamples value per numbered body variable. Submission does not mean Meta approval.
- Use a unique idempotency key for each intended action. Reuse the same key and exactly the same input on a retry. The body key takes precedence over Idempotency-Key.
Response
The response wraps tool-specific data in result. Save operation_id and inspect get_operation with operationId if the outcome is uncertain. completed means the operation completed; it does not prove message delivery or Meta approval. An uncertain operation returns HTTP 409 with error.operation_id.
Every response includes X-Request-Id. Errors use the shared error format and retry rules.
Schemas
Input JSON Schema
{
"type": "object",
"properties": {
"idempotencyKey": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]{8,128}$",
"description": "A fresh random UUID for each new action; never build it from dates, names, counters or step numbers, which repeat across runs. Reuse it exactly only to retry the same action."
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 512,
"description": "Lowercase template name with underscores"
},
"language": {
"type": "string",
"minLength": 2,
"maxLength": 12,
"description": "Template language, for example en_US"
},
"category": {
"type": "string",
"enum": [
"UTILITY",
"MARKETING"
]
},
"body": {
"type": "string",
"minLength": 1,
"maxLength": 1024
},
"bodyExamples": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 1024
},
"maxItems": 20,
"description": "One sample value for each numbered body variable, in order"
},
"header": {
"type": "string",
"minLength": 1,
"maxLength": 60
},
"footer": {
"type": "string",
"minLength": 1,
"maxLength": 60
}
},
"required": [
"idempotencyKey",
"name",
"language",
"category",
"body"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}Response JSON Schema
{
"type": "object",
"properties": {
"operation_id": {
"type": "string",
"format": "uuid"
},
"status": {
"type": "string",
"enum": [
"completed"
]
},
"replayed": {
"type": "boolean"
},
"result": {
"type": "object",
"properties": {
"template_id": {
"type": "string"
},
"name": {
"type": "string"
},
"language": {
"type": "string"
},
"category": {
"type": "string"
},
"status": {
"type": "string"
},
"note": {
"type": "string"
}
},
"required": [],
"additionalProperties": true
},
"note": {
"type": [
"string",
"null"
]
}
},
"required": [
"operation_id",
"status",
"result"
],
"additionalProperties": true
}