The outer wrapper — always the same
messages[0] first, then checks message.type:
Per-type parsing
Text messageWhy media gives you an ID, not the file
Meta never sends the actual file in the webhook — only theid. To get the file, call the
Media API separately:
Testing with Postman
You can simulate any inbound message type without a real phone by sending a POST to your webhook URL:Frequently asked
How do I get the text a customer sent me?
How do I get the text a customer sent me?
Check
message.type === 'text', then read message.text.body.How do I get an image a customer sent me?
How do I get an image a customer sent me?
Read
message.image.id from the payload, then call the Media API with that ID to get a
download URL for the actual file. See Media API.How do I know which button the customer tapped?
How do I know which button the customer tapped?
What if changes.messages is missing?
What if changes.messages is missing?
The webhook also fires for delivery/read status updates, which have
statuses instead of
messages. Always guard with if (!changes?.messages) return before parsing.
