Webhook Notification Payload Examples:
1.Text Messages:
{
"object": "whatsapp_business_account",
"entry": [{
"id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes": [{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": PHONE_NUMBER,
"phone_number_id": PHONE_NUMBER_ID
},
"contacts": [{
"profile": {
"name": "NAME"
},
"wa_id": PHONE_NUMBER
}],
"messages": [{
"from": PHONE_NUMBER,
"id": "wamid.ID",
"timestamp": TIMESTAMP,
"text": {
"body": "MESSAGE_BODY"
},
"type": "text"
}]
},
"field": "messages"
}]
}]
}
2.Media Messages:
{
"object": "whatsapp_business_account",
"entry": [{
"id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes": [{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": PHONE_NUMBER,
"phone_number_id": PHONE_NUMBER_ID
},
"contacts": [{
"profile": {
"name": "NAME"
},
"wa_id": "WHATSAPP_ID"
}],
"messages": [{
"from": PHONE_NUMBER,
"id": "wamid.ID",
"timestamp": TIMESTAMP,
"type": "image",
"image": {
"caption": "CAPTION",
"mime_type": "image/jpeg",
"sha256": "IMAGE_HASH",
"id": "ID"
}
}]
},
"field": "messages"
}]
}]
}
When you receive a sticker, you will get the following notification:
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "ID",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "PHONE_NUMBER",
"phone_number_id": "PHONE_NUMBER_ID"
},
"contacts": [
{
"profile": {
"name": "NAME"
},
"wa_id": "ID"
}
],
"messages": [
{
"from": "SENDER_PHONE_NUMBER",
"id": "wamid.ID",
"timestamp": "TIMESTAMP",
"type": "sticker",
"sticker": {
"mime_type": "image/webp",
"sha256": "HASH",
"id": "ID"
}
}
]
},
"field": "messages"
}
]
}
]
}
3.Unknown Messages:
{
"object": "whatsapp_business_account",
"entry": [{
"id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes": [{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "PHONE_NUMBER",
"phone_number_id": "PHONE_NUMBER_ID"
},
"contacts": [{
"profile": {
"name": "NAME"
},
"wa_id": "WHATSAPP_ID"
}],
"messages": [{
"from": "PHONE_NUMBER",
"id": "wamid.ID",
"timestamp": "TIMESTAMP",
"errors": [
{
"code": 131051,
"details": "Message type is not currently supported",
"title": "Unsupported message type"
}],
"type": "unknown"
}]
}
"field": "messages"
}],
}]
}
4.Contacts Messages:
{
"object":"whatsapp_business_account",
"entry":[{
"id":"WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes":[{
"value":{
"messaging_product":"whatsapp",
"metadata": {
"display_phone_number":"PHONE_NUMBER",
"phone_number_id":"PHONE_NUMBER_ID"
},
"contacts": [{
"profile":{
"name":"NAME"
},
"wa_id":"WHATSAPP_ID"
}],
"messages":[{
"from":"PHONE_NUMBER",
"id":"wamid.ID",
"timestamp":"TIMESTAMP",
"contacts":[{
"addresses":[{
"city":"CONTACT_CITY",
"country":"CONTACT_COUNTRY",
"country_code":"CONTACT_COUNTRY_CODE",
"state":"CONTACT_STATE",
"street":"CONTACT_STREET",
"type":"HOME or WORK",
"zip":"CONTACT_ZIP"
}],
"birthday":"CONTACT_BIRTHDAY",
"emails":[{
"email":"CONTACT_EMAIL",
"type":"WORK or HOME"
}],
"name":{
"formatted_name":"CONTACT_FORMATTED_NAME",
"first_name":"CONTACT_FIRST_NAME",
"last_name":"CONTACT_LAST_NAME",
"middle_name":"CONTACT_MIDDLE_NAME",
"suffix":"CONTACT_SUFFIX",
"prefix":"CONTACT_PREFIX"
},
"org":{
"company":"CONTACT_ORG_COMPANY",
"department":"CONTACT_ORG_DEPARTMENT",
"title":"CONTACT_ORG_TITLE"
},
"phones":[{
"phone":"CONTACT_PHONE",
"wa_id":"CONTACT_WA_ID",
"type":"HOME or WORK>"
}],
"urls":[{
"url":"CONTACT_URL",
"type":"HOME or WORK"
}]
}]
}]
},
"field":"messages"
}]
}]
}
5.Received Callback from a Quick Reply Button:
{
"object": "whatsapp_business_account",
"entry": [{
"id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes": [{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": PHONE_NUMBER,
"phone_number_id": PHONE_NUMBER_ID
},
"contacts": [{
"profile": {
"name": "NAME"
},
"wa_id": "WHATSAPP_ID"
}],
"messages": [{
"context": {
"from": PHONE_NUMBER,
"id": "wamid.ID"
},
"from": "16315551234",
"id": "wamid.ID",
"timestamp": TIMESTAMP,
"type": "button",
"button": {
"text": "No",
"payload": "No-Button-Payload"
}
}]
},
"field": "messages"
}]
}]
}
6.Received Answer From List Message:
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "PHONE_NUMBER",
"phone_number_id": "PHONE_NUMBER_ID",
},
"contacts": [
{
"profile": {
"name": "NAME"
},
"wa_id": "PHONE_NUMBER_ID"
}
],
"messages": [
{
"from": PHONE_NUMBER_ID,
"id": "wamid.ID",
"timestamp": TIMESTAMP,
"interactive": {
"list_reply": {
"id": "list_reply_id",
"title": "list_reply_title",
"description": "list_reply_description"
},
"type": "list_reply"
},
"type": "interactive"
}
]
},
"field": "messages"
}
]
}
]
}
7.Received Answer to Reply Button:
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "PHONE_NUMBER",
"phone_number_id": PHONE_NUMBER_ID,
},
"contacts": [
{
"profile": {
"name": "NAME"
},
"wa_id": "PHONE_NUMBER_ID"
}
],
"messages": [
{
"from": PHONE_NUMBER_ID,
"id": "wamid.ID",
"timestamp": TIMESTAMP,
"interactive": {
"button_reply": {
"id": "unique-button-identifier-here",
"title": "button-text",
},
"type": "button_reply"
},
"type": "interactive"
}
]
},
"field": "messages"
}
]
}
]
}
8.Received Message Triggered by Click to WhatsApp Ads:
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "ID",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "PHONE_NUMBER",
"phone_number_id": "PHONE_NUMBER_ID"
},
"contacts": [
{
"profile": {
"name": "NAME"
},
"wa_id": "ID"
}
],
"messages": [
{
"referral": {
"source_url": "AD_OR_POST_FB_URL",
"source_id": "ADID",
"source_type": "ad or post",
"headline": "AD_TITLE",
"body": "AD_DESCRIPTION",
"media_type": "image or video",
"image_url": "RAW_IMAGE_URL",
"video_url": "RAW_VIDEO_URL",
"thumbnail_url": "RAW_THUMBNAIL_URL",
},
"from": "SENDER_PHONE_NUMBERID",
"id": "wamid.ID",
"timestamp": "TIMESTAMP",
"type": "text",
"text": {
"body": "BODY"
}
}
]
},
"field": "messages"
}
]
}
]
}
9.Product Inquiry Messages:
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "ID",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "PHONE_NUMBER",
"phone_number_id": "PHONE_NUMBER_ID",
},
"contacts": [
{
"profile": {
"name": "NAME"
},
"wa_id": "PHONE_NUMBER_ID"
}
],
"messages": [
{
"from": "PHONE_NUMBER",
"id": "wamid.ID",
"text": {
"body": "MESSAGE_TEXT"
},
"context": {
"from": "PHONE_NUMBER",
"id": "wamid.ID",
"referred_product": {
"catalog_id": "CATALOG_ID",
"product_retailer_id": "PRODUCT_ID"
}
},
"timestamp": "TIMESTAMP",
"type": "text"
}
]
},
"field": "messages"
}
]
}
]
}
10.Order Messages:
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "8856996819413533",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "16505553333",
"phone_number_id": "phone-number-id",
},
"contacts": [
{
"profile": {
"name": "Kerry Fisher"
},
"wa_id": "16315551234"
}
],
"messages": [
{
"from": "16315551234",
"id": "wamid.ABGGFlCGg0cvAgo6cHbBhfK5760V",
"order": {
"catalog_id": "the-catalog_id",
"product_items": [
{
"product_retailer_id":"the-product-SKU-identifier",
"quantity":"number-of-item",
"item_price":"unitary-price-of-item",
"currency":"price-currency"
},
...
],
"text":"text-message-sent-along-with-the-order"
},
"context": {
"from": "16315551234",
"id": "wamid.gBGGFlaCGg0xcvAdgmZ9plHrf2Mh-o"
},
"timestamp": "1603069091",
"type": "order"
}
]
},
"field": "messages"
}
]
}
]
}
11.User Changed Number Notification:
{
"object": "whatsapp_business_account",
"entry": [{
"id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes": [{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": PHONE_NUMBER,
"phone_number_id": PHONE_NUMBER_ID
},
"messages": [{
"from": PHONE_NUMBER,
"id": "wamid.ID",
"system": {
"body": "NAME changed from PHONE_NUMBER to PHONE_NUMBER",
"new_wa_id": NEW_PHONE_NUMBER,
"type": "user_changed_number"
},
"timestamp": TIMESTAMP,
"type": "system"
}]
},
"field": "messages"
}]
}]
}
12.Status: Message Sent:
The following notification is received when a business sends a message as part
of a user-initiated conversation (if that conversation did not originate in a free
entry point):
{
"object": "whatsapp_business_account",
"entry": [{
"id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes": [{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "PHONE_NUMBER",
"phone_number_id": "PHONE_NUMBER_ID"
},
"statuses": [{
"id": "wamid.ID",
"recipient_id": "PHONE_NUMBER",
"status": "sent",
"timestamp": "TIMESTAMP",
"conversation": {
"id": "CONVERSATION_ID",
"expiration_timestamp": TIMESTAMP,
"origin": {
"type": "user_initiated"
}
},
"pricing": {
"pricing_model": "CBP",
"billable": true,
"category": "user_initiated"
}
}]
},
"field": "messages"
}]
}]
}
The following notification is received when a business sends a message as part of a
business-initiated conversation:
{
"object": "whatsapp_business_account",
"entry": [{
"id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes": [{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "PHONE_NUMBER",
"phone_number_id": "PHONE_NUMBER_ID"
},
"statuses": [{
"id": "wamid.ID",
"recipient_id": "PHONE_NUMBER",
"status": "sent",
"timestamp": "TIMESTAMP",
"conversation": {
"id": "CONVERSATION_ID",
"expiration_timestamp": TIMESTAMP,
"origin": {
"type": "business_initated"
}
},
"pricing": {
"pricing_model": "CBP",
"billable": true,
"category": "business_initated"
}
}]
},
"field": "messages"
}]
}]
}
The following notification is received when a business sends a message in reply to
a user-initiated conversation originating from free entry points:
{
"object": "whatsapp_business_account",
"entry": [{
"id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes": [{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "PHONE_NUMBER",
"phone_number_id": "PHONE_NUMBER_ID"
},
"statuses": [{
"id": "wamid.ID",
"status": "sent",
"timestamp": TIMESTAMP,
"recipient_id": PHONE_NUMBER,
"conversation": {
"id": "CONVERSATION_ID",
"expiration_timestamp": TIMESTAMP,
"origin": {
"type": "referral_conversion"
}
},
"pricing": {
"billable": false,
"pricing_model": "CBP",
"category": "referral_conversion"
}
}]
},
"field": "messages"
}]
}]
}
13. Status: Message Delivered:
The following notification is received when a business’ message is delivered and
that message is part of a user-initiated conversation (if that conversation did not
originate in a free entry point):
{
"object": "whatsapp_business_account",
"entry": [{
"id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes": [{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "PHONE_NUMBER",
"phone_number_id": "PHONE_NUMBER_ID"
},
"statuses": [{
"id": "wamid.ID",
"recipient_id": "PHONE_NUMBER",
"status": "delivered",
"timestamp": "TIMESTAMP",
"conversation": {
"id": "CONVERSATION_ID",
"expiration_timestamp": TIMESTAMP,
"origin": {
"type": "user_initiated"
}
},
"pricing": {
"pricing_model": "CBP",
"billable": true,
"category": "user_initiated"
}
}]
},
"field": "messages"
}]
}]
}
The following notification is received when a business’ message is delivered and
that message is part of a business-initiated conversation:
{
"object": "whatsapp_business_account",
"entry": [{
"id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes": [{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "PHONE_NUMBER",
"phone_number_id": "PHONE_NUMBER_ID"
},
"statuses": [{
"id": "wamid.ID",
"recipient_id": "PHONE_NUMBER",
"status": "delivered",
"timestamp": "TIMESTAMP",
"conversation": {
"id": "CONVERSATION_ID",
"expiration_timestamp": TIMESTAMP,
"origin": {
"type": "business_initiated"
}
},
"pricing": {
"pricing_model": "CBP",
"billable": true,
"category":"business-initiated"
}
}]
},
"field": "messages"
}]
}]
}
The following notification is received when a business’ message is delivered and
that message is part of a user-initiated conversation originating from a free entry
point:
{
"object": "whatsapp_business_account",
"entry": [{
"id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes": [{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "PHONE_NUMBER",
"phone_number_id": "PHONE_NUMBER_ID"
},
"statuses": [{
"id": "wamid.ID",
"status": "sent",
"timestamp": "TIMESTAMP",
"recipient_id": "PHONE_NUMBER",
"conversation": {
"id": "CONVERSATION_ID",
"expiration_timestamp": TIMESTAMP,
"origin" {
"type": "referral_conversion"
}
},
"pricing": {
"billable": false,
"pricing_model": "CBP",
"category": "referral_conversion"
}
}]
},
"field": "messages"
}]
}]
}
14.Status: Message Deleted:
{
"object": "whatsapp_business_account",
"entry": [{
"id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes": [{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": PHONE_NUMBER,
"phone_number_id": PHONE_NUMBER
},
"contacts": [{
"profile": {
"name": "NAME"
},
"wa_id": PHONE_NUMBER
}],
"messages": [{
"from": PHONE_NUMBER,
"id": "wamid.ID",
"timestamp": TIMESTAMP,
"errors": [{
"code": 131051,
"details": "Message type is not currently supported",
"title": "Unsupported message type"
}],
"type": "unsupported"
}]
},
"field": "messages"
}]
}]
}
15.Status: Message Failed:
{
"object": "whatsapp_business_account",
"entry": [{
"id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes": [{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": PHONE_NUMBER,
"phone_number_id": PHONE_NUMBER_ID
},
"statuses": [{
"id": "wamid.ID",
"status": "failed",
"timestamp": TIMESTAMP,
"recipient_id": PHONE_NUMBER,
"errors": [{
"code": 131014,
"title": "Request for url https://URL.jpg failed with error: 404 (Not Found)"
}]
}]
},
"field": "messages"
}]
}]
}