WhatsApp Template Reviewed Webhook Examples

🚧

Prerequisites

Make sure that your webhook endpoint is listening for whatsapp.template.reviewed events. See also Configure Webhooks, Retrieve a webhook endpoint API.

Template Approved

In this case, your webhook endpoint received a template APPROVED event:

  • The template statusUpateEvent is APPROVED.
  • The template status is now APPROVED.

Code sample

curl 'https://YOUR-WEBHOOK-ENDPOINT-URL' \
-H 'Content-Type: application/json' \
-d '{
  "id": "evt_eEMtA0PkkyACiS5o",
  "type": "whatsapp.template.reviewed",
  "apiVersion": "v2",
  "createTime": "2023-02-20T12:00:00.000Z",
  "whatsappTemplate": {
    "wabaId": "WABA-ID",
    "name": "template_name",
    "language": "en",
    "category": "MARKETING",
    "status": "APPROVED",
    "reason": "NONE",
    "statusUpdateEvent": "APPROVED"
  }
}'

Note

  • Use wabaId, name, and language to identify the template in your system.
  • The statusUpdateEvent describes what happened on this template status, while the status is the current status of the template. They are not always the same.
  • This event occurs when a template is approved by Meta. The template can be the one you created or edited before. This also happens when a paused template changes to approved automatically.
  • Once a template is approved, you can use it to send template messages.

Template Rejected

In this case, your webhook endpoint received a template REJECTED event:

  • The template statusUpateEvent is REJECTED.
  • The template status is now REJECTED.

Code sample

curl 'https://YOUR-WEBHOOK-ENDPOINT-URL' \
-H 'Content-Type: application/json' \
-d '{
  "id": "evt_eEMtA0PkkyACiS5o",
  "type": "whatsapp.template.reviewed",
  "apiVersion": "v2",
  "createTime": "2023-02-20T12:00:00.000Z",
  "whatsappTemplate": {
    "wabaId": "WABA-ID",
    "name": "template_name",
    "language": "en",
    "category": "MARKETING",
    "status": "REJECTED",
    "reason": "SCAM",
    "statusUpdateEvent": "REJECTED"
  }
}'

Note

  • This event occurs when a template is rejected. The template can be the one you created or edited before.
  • Once a template is rejected, you cannot use it to send template messages. You can edit this template to start a new review.

Template Paused

In this case, your webhook endpoint received a template PAUSED event:

  • The template statusUpateEvent is PAUSED.
  • The template status is now PAUSED.
  • The eason why the template is paused.

Code sample

curl 'https://YOUR-WEBHOOK-ENDPOINT-URL' \
-H 'Content-Type: application/json' \
-d '{
  "id": "evt_eEMtA0PkkyACiS5o",
  "type": "whatsapp.template.reviewed",
  "apiVersion": "v2",
  "createTime": "2023-02-20T12:00:00.000Z",
  "whatsappTemplate": {
    "wabaId": "WABA-ID",
    "name": "template_name",
    "language": "en",
    "category": "MARKETING",
    "status": "PAUSED",
    "reason": "NONE",
    "statusUpdateEvent": "PAUSED"
  }
}'

Note

  • This event occurs when a template is paused. You cannot use it to send messages.
  • Pausing durations are as follows:
    • 1st Instance: Paused for 3 hours
    • 2nd Instance: Paused for 6 hours
    • 3rd Instance: Disabled
  • A APPROVED event occurs when a paused template changes to normal status.
  • See also Template Pausing.

Template Flagged

In this case, your webhook endpoint received a template FLAGGED event:

  • The template statusUpateEvent is FLAGGED.
  • The template status is now APPROVED.
  • Contains the date when the template will be disabled.

Code sample

curl 'https://YOUR-WEBHOOK-ENDPOINT-URL' \
-H 'Content-Type: application/json' \
-d '{
  "id": "evt_eEMtA0PkkyACiS5o",
  "type": "whatsapp.template.reviewed",
  "apiVersion": "v2",
  "createTime": "2023-02-20T12:00:00.000Z",
  "whatsappTemplate": {
    "wabaId": "WABA-ID",
    "name": "template_name",
    "language": "en",
    "category": "MARKETING",
    "status": "APPROVED",
    "reason": "Your WhatsApp message template has been paused for 3 hours until Feb 23 at 5:28 AM UTC because it had issues.",
    "statusUpdateEvent": "FLAGGED",
    "disableDate": "February 28, 2023"
  }
}'

Note

  • The statusUpdateEvent describes what happened on this template status, while the status is the current status of the template. They are not always the same.

Template Disabled

In this case, your webhook endpoint received a template DISABLED event:

  • The template statusUpateEvent is DISABLED.
  • The template status is now DISABLED.

Code sample

curl 'https://YOUR-WEBHOOK-ENDPOINT-URL' \
-H 'Content-Type: application/json' \
-d '{
  "id": "evt_eEMtA0PkkyACiS5o",
  "type": "whatsapp.template.reviewed",
  "apiVersion": "v2",
  "createTime": "2023-02-20T12:00:00.000Z",
  "whatsappTemplate": {
    "wabaId": "WABA-ID",
    "name": "template_name",
    "language": "en",
    "category": "MARKETING",
    "status": "DISABLED",
    "reason": "NONE",
    "statusUpdateEvent": "DISABLED"
  }
}'

Note

  • A template status changes to DISABLED at its 3rd pausing.
  • See also Template Pausing.

Template Pending Deletion

In this case, your webhook endpoint received a template PENDING_DELETION event:

  • The template statusUpateEvent is PENDING_DELETION.
  • The template status is now DELETED.

Code sample

curl 'https://YOUR-WEBHOOK-ENDPOINT-URL' \
-H 'Content-Type: application/json' \
-d '{
  "id": "evt_eEMtA0PkkyACiS5o",
  "type": "whatsapp.template.reviewed",
  "apiVersion": "v2",
  "createTime": "2023-02-20T12:00:00.000Z",
  "whatsappTemplate": {
    "wabaId": "WABA-ID",
    "name": "template_name",
    "language": "en",
    "category": "MARKETING",
    "status": "DELETED",
    "reason": "NONE",
    "statusUpdateEvent": "PENDING_DELETION"
  }
}'

Note

  • Occurs when you delete a template.
  • The message template is being deleted. Remember that the name of this template can't be used again for 30 days. You'll need to use a different name to create new message templates.