PrerequisitesMake sure that your webhook endpoint is listening for
whatsapp.message.updatedevents. See also Configure Webhooks, Retrieve a webhook endpoint API.
Message Sent
In this case, your webhook endpoint received a message sent event:
- The message
statusissent. - Contains information about the conversation, including the time when the conversation expires, and the origin type.
- Contains the estimated
totalPricewe may charge you. - Contains
wamid, which is the original message ID on WhatsApp’s platform, starting withwamid..
Code sample
curl 'https://YOUR-WEBHOOK-ENDPOINT-URL' \
-H 'Content-Type: application/json' \
-d '{
"id": "evt_eEVCy8eNqD9EvcFI",
"type": "whatsapp.message.updated",
"apiVersion": "v2",
"createTime": "2023-02-22T12:00:00.000Z",
"whatsappMessage": {
"id": "63f5d602367ea403f8175a6c",
"wamid": "wamid.BgNODYxN...",
"status": "sent",
"conversation": {
"id": "00e5a7e14a588d96bd2343d105d03ec5",
"originType": "marketing",
"expireTime": "2023-02-23T12:00:00.000Z"
},
"totalPrice": 0.0,
"currency": "USD",
"createTime": "2022-03-01T12:00:00.000Z",
"sendTime": "2022-03-01T12:00:01.000Z",
"bizType": "whatsapp",
"type": "text",
"text": {
"body": "Hi there! How can we help?"
}
}
}'Note
-
There is a charge when the first business message with this conversation ID is delivered, initiating the 24 hour conversation session.
totalPriceis only an estimated price before the first message is delivered, and it becomes the final price when thestatusisdeliveredorread. The balance taken up by those messages that are sent but haven't been delivered will not be available until the messages are dropped (Sent messages that are not delivered for 30 days are dropped). -
conversationis included after the message issent.conversation.expireTimeis only an estimated time when the first message of this conversation is sent, and it will be refreshed when the first message of this conversation is delivered. See alsoTracking Conversations.The illustration below reflects an extreme example of conversation refreshing.

-
Generally, a
sentmessage changes todeliveredorreadsoon, except:- The recipient's WhatsApp account is offline, your sent WhatsApp messages won’t be delivered until the recipient has working or active internet services.
- Any message sent to a contact who has blocked you will always show the message
sent, and will never change todelivered. - The recipient has turned off read receipts, and you won’t receive the message
readreceipts. - The message changes to
failedlater with error code131026, which means "Message Undeliverable.", or "Receiver is incapable of receiving this message". This is most likely that the recipient is not registered, or is using an old WhatsApp version. - The message was not delivered to create a high quality user experience. See Per-User Marketing Template Message Limits.
Message Delivered
In this case, your webhook endpoint received a message delivered event:
- The message
statusisdelivered.
Code sample
curl 'https://YOUR-WEBHOOK-ENDPOINT-URL' \
-H 'Content-Type: application/json' \
-d '{
"id": "evt_eEVCy8eNqD9EvcFI",
"type": "whatsapp.message.updated",
"apiVersion": "v2",
"createTime": "2023-02-22T12:00:00.000Z",
"whatsappMessage": {
"id": "63f5d602367ea403f8175a6c",
"wamid": "wamid.BgNODYxN...",
"status": "delivered",
"conversation": {
"id": "00e5a7e14a588d96bd2343d105d03ec5",
"type": "REGULAR",
"originType": "marketing",
"expireTime": "2023-02-23T12:00:00.000Z"
},
"totalPrice": 0.0,
"currency": "USD",
"createTime": "2022-03-01T12:00:00.000Z",
"sendTime": "2022-03-01T12:00:01.000Z",
"deliverTime": "2022-03-01T12:00:02.000Z",
"bizType": "whatsapp",
"type": "text",
"text": {
"body": "Hi there! How can we help?"
}
}
}'Note
- There is a charge when the first business message with this conversation ID is delivered, initiating the 24 hour conversation session.
- This event indicates that the message sent by your business was delivered to the user’s device.
- For a status to be
read, it must have beendelivered. In some scenarios, such as when a user is in the chat screen and a message arrives, the message isdeliveredandreadalmost simultaneously. In this or other similar scenarios, thedeliverednotification will not be sent back, as it is implied that a message has been delivered if it has been read. The reason for this behavior is internal optimization. - It's possible for us to generate more than 1
deliveredwebhook event for the same message, especially if the end customer is using multiple devices.
Message Read
In this case, your webhook endpoint received a message read event:
- The message
statusisread.
Code sample
curl 'https://YOUR-WEBHOOK-ENDPOINT-URL' \
-H 'Content-Type: application/json' \
-d '{
"id": "evt_eEVCy8eNqD9EvcFI",
"type": "whatsapp.message.updated",
"apiVersion": "v2",
"createTime": "2023-02-22T12:00:00.000Z",
"whatsappMessage": {
"id": "63f5d602367ea403f8175a6c",
"wamid": "wamid.BgNODYxN...",
"status": "read",
"conversation": {
"id": "00e5a7e14a588d96bd2343d105d03ec5",
"type": "REGULAR",
"originType": "marketing",
"expireTime": "2023-02-23T12:00:00.000Z"
},
"totalPrice": 0.0,
"currency": "USD",
"createTime": "2022-03-01T12:00:00.000Z",
"sendTime": "2022-03-01T12:00:01.000Z",
"deliverTime": "2022-03-01T12:00:02.000Z",
"readTime": "2022-03-01T12:00:02.000Z",
"bizType": "whatsapp",
"type": "text",
"text": {
"body": "Hi there! How can we help?"
}
}
}'Note
- This event indicates that the message sent by your business was read by the user.
- If the recipient has turned off read receipts, you won’t receive the message
readreceipts.
Message Failed
In this case, your webhook endpoint received a message failed event:
- The message
statusisfailed. - Contains
errroCode,errorMessage, andwhatsappApiError.
Code sample
curl 'https://YOUR-WEBHOOK-ENDPOINT-URL' \
-H 'Content-Type: application/json' \
-d '{
"id": "evt_eEVCy8eNqD9EvcFI",
"type": "whatsapp.message.updated",
"apiVersion": "v2",
"createTime": "2023-02-22T12:00:00.000Z",
"whatsappMessage": {
"id": "63f5d602367ea403f8175a6c",
"wamid": "wamid.BgNODYxN...",
"status": "failed",
"errorCode": "100",
"errorMessage": "Parameter Invalid",
"whatsappApiError": {
"message": "(#100) Invalid parameter",
"type": "OAuthException",
"code": "100",
"fbtrace_id": "AwmiSOCojlAkqvjCTjGt37r",
"error_data": {
"messaging_product": "whatsapp",
"details": "Parameter Invalid"
}
},
"totalPrice": 0.0,
"currency": "USD",
"bizType": "whatsapp",
"type": "text",
"text": {
"body": "Hi there! How can we help?"
}
}
}'Note
- These events are intended to notify you of status changes for outbound messages you've previously sent to customers.
- The reason for the messaging failure is typically the message request parameters are invalid, the customer's phone number is not registered, etc. See also WhatsApp Errors for error handling.
whatsappApiErroris provided if we tried to submit this message to Meta's WhatsApp platform to help you understand the error details. See also Cloud API Error Codes.- We do not charge you for failed messages.
