Webhook Verification
Meta requires webhook verification during setup. Your endpoint must respond to GET requests with the challenge parameter.Query Parameters
Must be
subscribe for verificationVerification token configured in your environment (
WHATSAPP_VERIFY_TOKEN)Random string from Meta that must be returned in the response
Response
Returns the challenge string with status 200 if verification succeeds, or 403 if token doesn’t match.Receive Webhook Events
Receive incoming WhatsApp messages and status updates from Meta.Webhook Payload Structure
Must be
whatsapp_business_accountMessage Types Supported
Text messages with
body fieldImages with
id, mime_type, and optional captionDocuments with
id, mime_type, filename, and optional captionAudio files with
id and mime_typeVideos with
id, mime_type, and optional captionLocation data with
latitude, longitude, name, and addressStatus Update Payload
Status Values
sent- Message sent to Meta serversdelivered- Message delivered to recipient’s deviceread- Message read by recipientfailed- Message failed to send
Response
Always returns200 OK to acknowledge receipt. Processing happens asynchronously.
Webhook Processing
The webhook automatically:- Logs all incoming webhooks to
whatsapp_webhook_logstable - Creates or updates conversations for new contacts
- Saves messages to the database
- Updates message delivery statuses
- Notifies assigned users of new messages