Webhooks
Webhooks are how you follow what happens on a number running Meta Business Agent — the customer's messages, the agent's replies, control changes, and delivery receipts. This page explains what you'll receive and how MBA conversations map to webhook fields.
Webhook setup is handled for you
You don't need to set anything up to receive MBA events. They're delivered to the same 360dialog webhook you already use for your number's messages, signed with x-360dialog-signature. You'll receive three fields:
messages— consumer messages that arrive while you hold the conversation.standby— the agent's conversation: consumer messages and the agent's replies while the agent holds the conversation.messaging_handovers— fired when control of a conversation is passed or taken.
You just need to handle these fields on your existing webhook — see how they map to conversations below.
How conversations map to fields
When your agent is enabled it is the primary responder and holds the conversation by default. Which field a consumer's message arrives on depends on who holds control at that moment:
The agent (default)
standby
standby (as message echoes)
You (after you take control)
messages
n/a — you send them
You take control simply by sending a message to the conversation. To hand control back to the agent, use Thread Control: pass with target_role: "ai_agent", or release. A pass or take also produces a messaging_handovers event.
The standby payload
The standby field uses the standard WhatsApp webhook envelope. Inside value.standby you get the full agent conversation:
standby.messages[]— the consumer's inbound messages.standby.message_echoes[]— the agent's replies. These are bizai-tagged:message.biz_opaque_callback_datacontains{"originator":"bizai", ...}, which is how you tell an agent-generated message apart from your own.
Route on the phone number using value.metadata.phone_number_id (or the WABA id at entry[].id).
Consumer inbound (standby.messages[]):
Agent reply (same standby field, standby.message_echoes[]):
The messaging_handovers payload
A messaging_handovers event fires when control of a conversation is passed or taken. Use it to know when the agent has handed a conversation to you (or vice versa). A release doesn't fire one.
There are two event types, set in value.type:
control_passed— sent to the new owner after apass. Thecontrol_passedobject holdsprevious_owner_role,new_owner_role, optionalmetadata(up to 2,000 characters), and, when available,conversation_context: an AI-generated summary of the conversation so far (type: "summary"withsummary.text).control_taken— sent to the previous owner after atake. Thecontrol_takenobject holdsprevious_owner_role,new_owner_roleandmetadata.
When previous_owner_role is ai_agent, the agent has just handed the conversation over, and your side is now responsible for the reply. value.sender.phone_number is the consumer, and value.recipient.phone_number_id identifies your number.
Signature validation
MBA webhooks 360dialog forwards to you are signed exactly like your normal message callbacks — with the x-360dialog-signature header. Validate them with your existing webhook secret; no new secret or verification path is needed.
Delivery receipts
Delivery and read receipts for the agent's messages are bizai-tagged (the same originator: bizai marker). They arrive on your webhook already, so you can track delivery of agent messages without any extra setup.
Last updated
Was this helpful?