Every WhatsApp Cloud API messages webhook has the same envelope: object set to whatsapp_business_account, then entry[].changes[] with field set to messages and a value object. Inside value, a messages array means a user sent something and a statuses array reports on something you sent. An errors array reports a system, app or account problem (Messages webhook reference, accessed 2026-11-04). Switch on messages[].type to pick the parser. The tables below come from Meta’s reference page for each type. The samples are Meta’s own, copied as published.
The envelope
| Path | What Meta says it holds |
|---|---|
object |
whatsapp_business_account |
entry[].id |
Messaging account ID |
entry[].changes[].field |
messages |
value.messaging_product |
whatsapp |
value.metadata.display_phone_number |
Business display phone number |
value.metadata.phone_number_id |
Business phone number ID, the one you send from |
value.contacts[].profile.name |
The user’s WhatsApp profile name |
value.contacts[].wa_id |
WhatsApp user ID, which “may not always match” the phone number |
value.contacts[].identity_key_hash |
Only with the identity change check enabled |
value.messages[].from |
WhatsApp user phone number |
value.messages[].id |
WhatsApp message ID (wamid.), your dedupe key |
value.messages[].timestamp |
Unix time “when the webhook was triggered”, as a string |
value.messages[].type |
The message type, which names the sibling object holding the content |
value.messages[].context |
Present on button and list replies, “Message business” button messages and forwarded messages |
Meta’s text reference sample shows the envelope in full (Text webhook reference):
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "102290129340398",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "15550783881",
"phone_number_id": "106540352242922"
},
"contacts": [
{
"profile": {
"name": "Sheena Nelson"
},
"wa_id": "16505551234"
}
],
"messages": [
{
"from": "16505551234",
"id": "wamid.HBgLMTY1MDM4Nzk0MzkVAgASGBQzQTRBNjU5OUFFRTAzODEwMTQ0RgA=",
"timestamp": "1749416383",
"type": "text",
"text": {
"body": "Does it come in another color?"
}
}
]
},
"field": "messages"
}
]
}
]
}
Each outgoing message “can have up to three separate webhooks”, one per status. Incoming-message errors sit inside messages, outgoing-message errors inside statuses, and system, app and account errors directly on value.
Who sent it: from, from_user_id and contacts
Business-scoped user IDs (BSUIDs) “began appearing in webhooks in early April 2026” (Business-scoped user IDs, accessed 2026-11-04). The per-type reference pages don’t show the BSUID fields. They are documented on the BSUID page.
| Field | Where | What it holds |
|---|---|---|
messages[].from_user_id |
Inbound message | The sender’s BSUID, such as US.13491208655302741918 |
messages[].from_parent_user_id |
Inbound message | Parent BSUID, only with parent BSUIDs enabled |
contacts[].user_id |
Inbound and status | The BSUID, with or without a username |
contacts[].profile.username |
Inbound and status | The username, omitted if the user hasn’t adopted one |
statuses[].recipient_user_id |
Status | Always the BSUID, however you addressed the message |
statuses[].recipient_parent_user_id |
Status | Parent BSUID, only with parent BSUIDs enabled |
from, wa_id and recipient_id are omitted when the user has a username and their phone number can’t be shared. Meta includes the number if you exchanged a message or call with it in the last 30 days, or the user is in your contact book. Meta’s BSUID sample shows that case, with no from and no wa_id:
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "102290129340398",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "15550783881",
"phone_number_id": "106540352242922"
},
"contacts": [
{
"profile": {
"name": "Sheena Nelson",
"username": "realsheenanelson"
},
"user_id": "US.13491208655302741918",
"parent_user_id": "US.ENT.11815799212886844830"
}
],
"messages": [
{
"from_user_id": "US.13491208655302741918",
"from_parent_user_id": "US.ENT.11815799212886844830",
"id": "wamid.HBgLMTY1MDM4Nzk0MzkVAgASGBQzQTRBNjU5OUFFRTAzODEwMTQ0RgA=",
"timestamp": "1749416383",
"type": "text",
"text": {
"body": "Does it come in another color?"
}
}
]
},
"field": "messages"
}
]
}
]
}
Read from first and fall back to from_user_id. For statuses, read recipient_id and fall back to recipient_user_id. This script prints one identity per event from a saved payload:
# identities.py. Run: python3 identities.py payload.json
import json
import sys
def identities(payload):
for entry in payload.get("entry", []):
for change in entry.get("changes", []):
value = change.get("value", {})
profiles = {}
for c in value.get("contacts", []):
for key in (c.get("wa_id"), c.get("user_id")):
if key:
profiles[key] = c.get("profile", {})
for m in value.get("messages", []):
who = m.get("from") or m.get("from_user_id")
if who is None and m.get("type") == "system":
who = m["system"].get("user_id") # user_changed_user_id has no from
username = profiles.get(who, {}).get("username")
yield "message", m.get("id"), m.get("type"), who, username
for s in value.get("statuses", []):
who = s.get("recipient_id") or s.get("recipient_user_id")
yield "status", s.get("id"), s.get("status"), who, None
if __name__ == "__main__":
with open(sys.argv[1]) as f:
for row in identities(json.load(f)):
print(row)
On group messages, recipient_id holds the group ID. Keying a contact table on these fields is covered in usernames and BSUIDs.
Text and ad referrals
text.body holds the message. Meta’s syntax block for text puts <!-- --> comments inside the JSON, so it is a template, not valid JSON. The working examples are on the same page.
| Field | When it appears |
|---|---|
context.from, context.id, context.referred_product |
The user tapped “Message business” on a product. referred_product has catalog_id and product_retailer_id |
context.forwarded |
Forwarded 5 times or fewer |
context.frequently_forwarded |
Forwarded more than 5 times |
referral.source_url, source_id, source_type |
Message came from a Click to WhatsApp ad. source_type is ad |
referral.body, headline, welcome_message.text |
The ad’s primary text, headline and greeting |
referral.media_type, image_url, video_url, thumbnail_url |
image or video, with the URL for that ad format |
referral.ctwa_clid |
Ad click ID, omitted for WhatsApp Status ad placements |
referral also appears in the syntax for image, audio, video, document, sticker, location and contacts. The reference pages show a referral example only for text. This is its message object:
{
"referral": {
"source_url": "https://fb.me/3cr4Wqqkv",
"source_id": "120226305854810726",
"source_type": "ad",
"body": "Summer Succulents are here!",
"headline": "Chat with us",
"media_type": "image",
"image_url": "https://scontent.xx.fbcdn.net/v/t45.1...",
"ctwa_clid": "Aff-n8ZTODiE79d22KtAwQKj9e_mIEOOj27vDVwFjN80dp4_0NiNhEgpGo0AHemvuSoifXaytfTzcchptiErTKCqTrJ5nW1h7IHYeYymGb5K5J5iTROpBhWAGaIAeUzHL50",
"welcome_message": {
"text": "Hi there! Let us know how we can help!"
}
},
"from": "16505551234",
"id": "wamid.HBgLMTY1MDM4Nzk0MzkVAgASGBQzQUQ0N0VFMDA2MTQ0RkJFNkNDNAA=",
"timestamp": "1750275992",
"text": {
"body": "Can I get more info about this?"
},
"type": "text"
}
Click to WhatsApp ads explains what ctwa_clid is for.
Media: image, audio, video, document, sticker
| Field | Types | Meaning |
|---|---|---|
id |
All five | Media asset ID. A GET on it returns the asset URL |
url |
All five | Download URL, queried with your access token. Rolling out gradually from November 12, 2025 |
mime_type |
All five | MIME type |
sha256 |
All five | SHA-256 hash of the file |
caption |
image, video, document | Caption text |
filename |
document | File name |
voice |
audio | true for a voice recording made in the WhatsApp client |
animated |
sticker | true for an animated sticker |
This is the image object from Meta’s sample (Image webhook reference). Meta truncates url with ... in all five samples:
{
"type": "image",
"image": {
"caption": "Taj Mahal",
"mime_type": "image/jpeg",
"sha256": "SfInY0gGKTsJlUWbwxC1k+FAD0FZHvzwfpvO0zX0GUI=",
"id": "1003383421387256",
"url": "https://lookaside.fbsbx.com/whatsapp_business/attachments/?mid=133..."
}
}
Meta prints this fragment without the outer braces; they’re added here so it parses. Audio, video, document and sticker follow the same shape under their own key. Downloading is covered in expired media URLs.
Location and shared contacts
| Type | Fields |
|---|---|
location |
latitude, longitude (decimal degrees), name, address, url (usually only for business locations) |
contacts |
Per card: name (formatted_name, first_name, last_name, middle_name, suffix, prefix), phones[] (phone, wa_id, type), emails[], addresses[], org, urls[], birthday |
A shared card arrives in messages[].contacts. The sender stays in value.contacts. Mixing the two puts a stranger’s name on your sender. Meta’s contacts sample (Contacts webhook reference):
{
"from": "16505551234",
"id": "wamid.HBgLMTY1MDM4Nzk0MzkVAgASGBQzQTRBNjU5OUFFRTAzODEwMTQ0RgA=",
"timestamp": "1744344496",
"type": "contacts",
"contacts": [
{
"name": {
"first_name": "Barbara",
"last_name": "Johnson",
"formatted_name": "Barbara J. Johnson"
},
"org": {
"company": "Social Tsunami"
},
"phones": [
{
"phone": "+1 (415) 555-0829",
"wa_id": "14125550829",
"type": "MOBILE"
}
]
}
]
}
Interactive replies and template buttons
type / interactive.type |
Fields | Source |
|---|---|---|
interactive / list_reply |
id (row ID), title, description |
Interactive reference |
interactive / button_reply |
id (button ID), title |
Interactive reference |
interactive / product |
retailer_id, title, description, currency_code, price_amount, sale_price_amount (on sale only), url |
Interactive reference |
interactive / nfm_reply |
name (flow), body (always Sent), response_json |
Flows guide |
button |
payload, text, both described as the quick-reply label |
Button reference |
price_amount is the price “multiplied by 1,000”. context.id on a reply points to the message that held the button or list. A button webhook comes from a quick-reply button in a template, while button_reply comes from an interactive message you sent (Interactive webhook reference, Button webhook reference).
Meta’s button reply sample:
{
"context": {
"from": "15550783881",
"id": "wamid.HBgLMTY1MDM4Nzk0MzkVAgARGBI3MEM2RUJFNkI0RENGQTVDRjUA"
},
"from": "16505551234",
"id": "wamid.HBgLMTY1MDM4Nzk0MzkVAgASGBQzQTZBQzg0MzQ4QjRCM0NGNkVGOAA=",
"timestamp": "1750025136",
"type": "interactive",
"interactive": {
"type": "button_reply",
"button_reply": {
"id": "cancel-button",
"title": "Cancel"
}
}
}
A Flow response is a string inside JSON, so parse response_json a second time. It “does not include the Flow ID”. Put your own identifier in flow_token when you send the Flow (Receive Flow response, accessed 2026-11-04). Meta’s sample is a messages fragment with placeholder values:
{
"messages": [{
"context": {
"from": "16315558151",
"id": "gBGGEiRVVgBPAgm7FUgc73noXjo"
},
"from": "<USER_ACCOUNT_NUMBER>",
"id": "<MESSAGE_ID>",
"type": "interactive",
"interactive": {
"type": "nfm_reply",
"nfm_reply": {
"name": "flow",
"body": "Sent",
"response_json": "{\"flow_token\": \"<FLOW_TOKEN>\", \"optional_param1\": \"<value1>\", \"optional_param2\": \"<value2>\"}"
}
},
"timestamp": "<MESSAGE_SEND_TIMESTAMP>"
}]
}
Reactions, orders and the rest
| Type | Fields | Notes |
|---|---|---|
reaction |
message_id, emoji |
Reactions to a business message from the last 30 days. Removing a reaction sends another webhook without emoji |
order |
catalog_id, text, product_items[] (product_retailer_id, quantity, item_price, currency) |
Quantity and price are integers |
system |
type, body, wa_id, user_id, parent_user_id, previous_user_id, previous_parent_user_id |
type is user_changed_number or user_changed_user_id. Meta’s samples have no contacts array, and the BSUID change has no from |
unsupported |
errors[], unsupported.type |
Codes 131051 “Message type unknown” and 131060 “This message is currently unavailable”. unsupported.type values: button, edit, errors, gif, group_invite, hsm, image, interactive, keep_in_chat, link_preview, list, location, media_placeholder, order, pin, poll_creation, poll_update, product, reaction |
edit |
original_message_id, message |
Coexistence numbers only, within 15 minutes of sending |
revoke |
original_message_id |
Coexistence numbers only, within two days of sending |
text with group_id |
group_id |
Group messages made with the Groups API |
Outside coexistence, an edit arrives as unsupported (Unsupported webhook reference). Meta’s group sample has a stray > at the end of its id, so it doesn’t look like a real wamid (Group webhook reference).
Statuses
| Field | Meaning |
|---|---|
id |
The wamid of the message you sent |
status |
sent, delivered, read, failed or played (a voice message played for the first time) |
timestamp |
Unix time when the webhook was triggered |
recipient_id |
The user’s phone number, or the group ID |
recipient_participant_id, recipient_type |
Group messages only |
recipient_identity_key_hash |
Only with the identity change check enabled |
biz_opaque_callback_data |
Only if you set it when sending |
conversation |
Omitted on v24.0+ unless the message is in a free entry point conversation |
conversation.id |
The conversation ID, when conversation is present |
conversation.expiration_timestamp |
On sent statuses only |
conversation.origin.type |
authentication, authentication_international, marketing, marketing_lite, referral_conversion, service, utility |
pricing |
On sent and on one of delivered or read, never both |
errors[] |
failed only: code, title, message, error_data.details, href |
pricing field |
Values |
|---|---|
pricing_model |
PMP. CBP only on webhooks sent before July 1, 2025 |
type |
regular, free_customer_service, free_entry_point, free_group_customer_service |
category |
authentication, authentication-international, group_marketing, group_service, group_utility, marketing, marketing_lite, referral_conversion, service, utility |
billable |
To be deprecated; Meta says to use type and category |
subtype |
free_tier, when “the service message is free because it was delivered within the business phone number’s free tier” (status reference, accessed 2026-11-23); paid_exempt, for free service messages under the government and non-profit policy |
Two changelog entries explain the newer shape. On October 8, 2025, Meta wrote that the status webhook “no longer includes the conversation object”. The played status was added on November 3, 2025 (WhatsApp changelog, accessed 2026-11-04).
A read status only counts once the message was delivered, and on an immediate read the delivered webhook “is not sent” (Status webhook reference, accessed 2026-11-04). The status sample on Meta’s messages overview page still shows "pricing_model": "CBP" and a conversation object, which is the pre-July-2025 shape. Use the status page’s samples. Its failed example:
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "102290129340398",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "15550783881",
"phone_number_id": "106540352242922"
},
"statuses": [
{
"id": "wamid.HBgLMTY1MDM4Nzk0MzkVAgARGBI0QUQ2MjA4NEYyRkExNjMyREUA",
"status": "failed",
"timestamp": "1751142888",
"recipient_id": "16505551234",
"errors": [
{
"code": 131049,
"title": "This message was not delivered to maintain healthy ecosystem engagement.",
"message": "This message was not delivered to maintain healthy ecosystem engagement.",
"error_data": {
"details": "In order to maintain a healthy ecosystem engagement, the message failed to be delivered."
},
"href": "/documentation/business-messaging/whatsapp/support/error-codes"
}
]
}
]
},
"field": "messages"
}
]
}
]
}
On the BSUID page’s status samples, contacts appears on delivered statuses and is omitted on failed ones. recipient_user_id is omitted from a failed status when you sent to a phone number. What each status means for your send logic is in status webhooks, and code 131049 has its own post.
Errors on value
System, app and account problems arrive as value.errors[], and Meta’s sample carries no messages or statuses (Errors webhook reference). Meta’s sample, as published:
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "102290129340398",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "15550783881",
"phone_number_id": "106540352242922"
},
"errors": [
{
"code": 130429,
"title": "Rate limit hit",
"message": "Rate limit hit",
"error_data": {
"details": "Message failed to send because there were too many messages sent from this phone number in a short period of time"
},
"href": "/documentation/business-messaging/whatsapp/support/error-codes"
}
]
},
"field": "messages"
}
]
}
]
}
A parser that only loops over messages and statuses drops these silently. Log every value that has neither. Complete receivers in Node.js and Python are in the Express post and the FastAPI post.
Z-API Omni team