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
isAPPROVED
. - The template
status
is nowAPPROVED
.
Note:
- Use
wabaId
,name
, andlanguage
to identify the template in your system. - The
statusUpdateEvent
describes what happened on this template status, while thestatus
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": "TRANSACTIONAL",
"status": "APPROVED",
"reason": "NONE",
"statusUpdateEvent": "APPROVED"
}
}'
Template Rejected
In this case, your webhook endpoint received a template REJECTED
event:
- The template
statusUpateEvent
isREJECTED
. - The template
status
is nowREJECTED
.
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 'X-API-Key: YOUR-API-KEY' \
--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": "TRANSACTIONAL",
"status": "REJECTED",
"reason": "SCAM",
"statusUpdateEvent": "REJECTED"
}
}'
Template Paused
In this case, your webhook endpoint received a template PAUSED
event:
- The template
statusUpateEvent
isPAUSED
. - The template
status
is nowPAUSED
. - 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 'X-API-Key: YOUR-API-KEY' \
--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": "TRANSACTIONAL",
"status": "PAUSED",
"reason": "NONE",
"statusUpdateEvent": "PAUSED"
}
}'
Template Flagged
In this case, your webhook endpoint received a template FLAGGED
event:
- The template
statusUpateEvent
isFLAGGED
. - 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 thestatus
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 'X-API-Key: YOUR-API-KEY' \
--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": "TRANSACTIONAL",
"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
isDISABLED
. - 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 'X-API-Key: YOUR-API-KEY' \
--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": "TRANSACTIONAL",
"status": "DISABLED",
"reason": "NONE",
"statusUpdateEvent": "DISABLED"
}
}'
Template Pending Deletion
In this case, your webhook endpoint received a template PENDING_DELETION
event:
- The template
statusUpateEvent
isPENDING_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 'X-API-Key: YOUR-API-KEY' \
--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": "TRANSACTIONAL",
"status": "DELETED",
"reason": "NONE",
"statusUpdateEvent": "PENDING_DELETION"
}
}'