WhaBuzz docs
API reference

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:

#List templates

GET/v1/templates

Auth: API key (tenant key, or app key with X-WhaBuzz-Tenant). Operation id: listTemplates.

Parameters

NameInTypeRequiredDescription
waba_idquerystringno
statusqueryAPPROVED or PENDING or REJECTED or PAUSED or DISABLEDno
namequerystringno

cURL:

curl -X GET "https://api.whabuzz.com/v1/templates" \
  -H "Authorization: Bearer $WHABUZZ_KEY"
bash

Responses

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"
        }
      ]
    }
  ]
}
json

cURL:

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"
        }
      ]
    }
  ]
}'
bash

Responses

200 Meta's response verbatim

{
  "id": "1689556908129832",
  "status": "PENDING",
  "category": "UTILITY"
}
json

400 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

NameInTypeRequiredDescription
template_idpathstringyes

cURL:

curl -X GET "https://api.whabuzz.com/v1/templates/$TEMPLATE_ID" \
  -H "Authorization: Bearer $WHABUZZ_KEY"
bash

Responses

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

NameInTypeRequiredDescription
template_idpathstringyes

Request body (application/json, required)

Request example:

{
  "components": [
    {
      "type": "BODY",
      "text": "Hi {{1}}, your plan renews on {{2}}.",
      "example": {
        "body_text": [
          [
            "Kerry",
            "31 Oct"
          ]
        ]
      }
    }
  ]
}
json

cURL:

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"
          ]
        ]
      }
    }
  ]
}'
bash

Responses

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

NameInTypeRequiredDescription
template_idpathstringyes

cURL:

curl -X DELETE "https://api.whabuzz.com/v1/templates/$TEMPLATE_ID" \
  -H "Authorization: Bearer $WHABUZZ_KEY"
bash

Responses

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"
}
json

cURL:

curl -X POST "https://api.whabuzz.com/v1/templates/sync" \
  -H "Authorization: Bearer $WHABUZZ_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "waba_id": "26059971920328384"
}'
bash

Responses

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

NameInTypeRequiredDescription
searchquerystringno
topicquerystringno
languagequerystringno

cURL:

curl -X GET "https://api.whabuzz.com/v1/templates/library" \
  -H "Authorization: Bearer $WHABUZZ_KEY"
bash

Responses

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)

FieldTypeRequiredDescription
filestring (binary)yes

cURL:

curl -X POST "https://api.whabuzz.com/v1/templates/media-handle" \
  -H "Authorization: Bearer $WHABUZZ_KEY" \
  -F file=@./photo.jpg
bash

Responses

200 Meta's response verbatim

{
  "h": "4::aW1hZ2UvanBlZw==:ARZ…"
}
json

This page as Markdown: /api/templates.md. All docs in one file: /llms-full.txt.