Templates
Meta message templates. Bodies and answers are Meta's.
Meta message templates. Bodies and answers are Meta's.
Base URL https://api.whabuzz.com. Every request needs Authorization: Bearer <key> unless the operation says otherwise; see Authentication. Errors follow the two-source contract.
Operations on this page:
GET /v1/templates: List templatesPOST /v1/templates: Submit a template to MetaGET /v1/templates/{template_id}: Get a templatePOST /v1/templates/{template_id}: Edit a templateDELETE /v1/templates/{template_id}: Delete a templatePOST /v1/templates/sync: Re-read every template from MetaGET /v1/templates/library: Browse Meta's template libraryPOST /v1/templates/media-handle: Upload a header sample and get a handle for template creation
#List templates
GET/v1/templates
Auth: API key (tenant key, or app key with X-WhaBuzz-Tenant). Operation id: listTemplates.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
waba_id | query | string | no | |
status | query | APPROVED or PENDING or REJECTED or PAUSED or DISABLED | no | |
name | query | string | no |
cURL:
curl -X GET "https://api.whabuzz.com/v1/templates" \
-H "Authorization: Bearer $WHABUZZ_KEY"bashResponses
200 Templates
{
"data": [
{
"id": "1689556908129833",
"waba_id": "26059971920328384",
"name": "diwali_offer",
"language": "en",
"category": "MARKETING",
"status": "REJECTED",
"status_reason": "INVALID_FORMAT: Template body contains variables at the start or end.",
"quality_score": null,
"parameter_format": "POSITIONAL",
"meta_object": {
"id": "1689556908129833",
"name": "diwali_offer",
"language": "en",
"status": "REJECTED",
"category": "MARKETING",
"components": [
{
"type": "BODY",
"text": "{{1}} off this Diwali"
}
]
}
}
]
}json#Submit a template to Meta
POST/v1/templates
Body is Meta's POST /{waba_id}/message_templates body plus waba_id. Response is Meta's.
Auth: API key (tenant key, or app key with X-WhaBuzz-Tenant). Operation id: createTemplate.
Request body (application/json, required)
Request example:
{
"waba_id": "26059971920328384",
"name": "renewal_reminder",
"language": "en",
"category": "UTILITY",
"parameter_format": "POSITIONAL",
"components": [
{
"type": "BODY",
"text": "Hi {{1}}, your membership renews on {{2}}.",
"example": {
"body_text": [
[
"Kerry",
"31 Oct"
]
]
}
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Renew now"
}
]
}
]
}jsoncURL:
curl -X POST "https://api.whabuzz.com/v1/templates" \
-H "Authorization: Bearer $WHABUZZ_KEY" \
-H "Content-Type: application/json" \
-d '{
"waba_id": "26059971920328384",
"name": "renewal_reminder",
"language": "en",
"category": "UTILITY",
"parameter_format": "POSITIONAL",
"components": [
{
"type": "BODY",
"text": "Hi {{1}}, your membership renews on {{2}}.",
"example": {
"body_text": [
[
"Kerry",
"31 Oct"
]
]
}
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Renew now"
}
]
}
]
}'bashResponses
200 Meta's response verbatim
{
"id": "1689556908129832",
"status": "PENDING",
"category": "UTILITY"
}json400 Meta rejected the template
{
"source": "meta",
"error": {
"message": "Invalid parameter",
"type": "OAuthException",
"code": 100,
"error_subcode": 2388023,
"is_transient": false,
"error_user_title": "Message template language is being deleted",
"error_user_msg": "New en content can't be added while the existing en content is being deleted. Try again in 4 weeks or consider creating a new message template.",
"fbtrace_id": "AqXyZ123"
}
}json#Get a template
GET/v1/templates/{template_id}
Auth: API key (tenant key, or app key with X-WhaBuzz-Tenant). Operation id: getTemplate.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template_id | path | string | yes |
cURL:
curl -X GET "https://api.whabuzz.com/v1/templates/$TEMPLATE_ID" \
-H "Authorization: Bearer $WHABUZZ_KEY"bashResponses
200 Template
{
"id": "1689556908129832",
"name": "renewal_reminder",
"language": "en",
"category": "UTILITY",
"status": "APPROVED",
"quality_score": "GREEN",
"meta_object": {
"id": "1689556908129832",
"status": "APPROVED"
}
}json#Edit a template
POST/v1/templates/{template_id}
Auth: API key (tenant key, or app key with X-WhaBuzz-Tenant). Operation id: editTemplate.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template_id | path | string | yes |
Request body (application/json, required)
Request example:
{
"components": [
{
"type": "BODY",
"text": "Hi {{1}}, your plan renews on {{2}}.",
"example": {
"body_text": [
[
"Kerry",
"31 Oct"
]
]
}
}
]
}jsoncURL:
curl -X POST "https://api.whabuzz.com/v1/templates/$TEMPLATE_ID" \
-H "Authorization: Bearer $WHABUZZ_KEY" \
-H "Content-Type: application/json" \
-d '{
"components": [
{
"type": "BODY",
"text": "Hi {{1}}, your plan renews on {{2}}.",
"example": {
"body_text": [
[
"Kerry",
"31 Oct"
]
]
}
}
]
}'bashResponses
200 Meta's response verbatim
{
"success": true
}json#Delete a template
DELETE/v1/templates/{template_id}
Auth: API key (tenant key, or app key with X-WhaBuzz-Tenant). Operation id: deleteTemplate.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template_id | path | string | yes |
cURL:
curl -X DELETE "https://api.whabuzz.com/v1/templates/$TEMPLATE_ID" \
-H "Authorization: Bearer $WHABUZZ_KEY"bashResponses
200 Meta's response verbatim
{
"success": true
}json#Re-read every template from Meta
POST/v1/templates/sync
Auth: API key (tenant key, or app key with X-WhaBuzz-Tenant). Operation id: syncTemplates.
Request body (application/json)
Request example:
{
"waba_id": "26059971920328384"
}jsoncURL:
curl -X POST "https://api.whabuzz.com/v1/templates/sync" \
-H "Authorization: Bearer $WHABUZZ_KEY" \
-H "Content-Type: application/json" \
-d '{
"waba_id": "26059971920328384"
}'bashResponses
200 Counts
{
"waba_id": "26059971920328384",
"fetched": 10,
"inserted": 0,
"updated": 2
}json#Browse Meta's template library
GET/v1/templates/library
Query parameters are passed to Meta unchanged.
Auth: API key (tenant key, or app key with X-WhaBuzz-Tenant). Operation id: listTemplateLibrary.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
search | query | string | no | |
topic | query | string | no | |
language | query | string | no |
cURL:
curl -X GET "https://api.whabuzz.com/v1/templates/library" \
-H "Authorization: Bearer $WHABUZZ_KEY"bashResponses
200 Meta's response verbatim
{
"data": [
{
"name": "appointment_reminder_1",
"language": "en_US",
"category": "UTILITY",
"topic": "APPOINTMENTS",
"body": "This is a reminder of your upcoming appointment on {{1}} at {{2}}."
}
],
"paging": {
"cursors": {
"before": "QVFI",
"after": "QVFJ"
}
}
}json#Upload a header sample and get a handle for template creation
POST/v1/templates/media-handle
Auth: API key (tenant key, or app key with X-WhaBuzz-Tenant). Operation id: createTemplateMediaHandle.
Request body (multipart/form-data, required)
| Field | Type | Required | Description |
|---|---|---|---|
file | string (binary) | yes |
cURL:
curl -X POST "https://api.whabuzz.com/v1/templates/media-handle" \
-H "Authorization: Bearer $WHABUZZ_KEY" \
-F file=@./photo.jpgbashResponses
200 Meta's response verbatim
{
"h": "4::aW1hZ2UvanBlZw==:ARZ…"
}jsonThis page as Markdown: /api/templates.md. All docs in one file: /llms-full.txt.