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.

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.

Code sample:

curl --location --request POST 'https://YOUR-WEBHOOK-ENDPOINT-URL/example-template-approved' \
--header 'Content-Type: application/json' \
--data-raw '{
  "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"
  }
}'

Template Rejected

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

  • The template statusUpateEvent is REJECTED.
  • The template status is now 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.

Code sample:

curl --location --request POST 'https://YOUR-WEBHOOK-ENDPOINT-URL/example-template-rejected' \
--header 'Content-Type: application/json' \
--data-raw '{
  "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"
  }
}'

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.

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.

Code sample:

curl --location --request POST 'https://YOUR-WEBHOOK-ENDPOINT-URL/example-template-paused' \
--header 'Content-Type: application/json' \
--data-raw '{
  "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"
  }
}'

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.

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.

Code sample:

curl --location --request POST 'https://YOUR-WEBHOOK-ENDPOINT-URL/example-template-flagged' \
--header 'Content-Type: application/json' \
--data-raw '{
  "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"
  }
}'

Template Disabled

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

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

Note:

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

Code sample:

curl --location --request POST 'https://YOUR-WEBHOOK-ENDPOINT-URL/example-template-disabled' \
--header 'Content-Type: application/json' \
--data-raw '{
  "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"
  }
}'

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.

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.

Code sample:

curl --location --request POST 'https://YOUR-WEBHOOK-ENDPOINT-URL/example-template-pendingdeletion' \
--header 'Content-Type: application/json' \
--data-raw '{
  "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"
  }
}'