End-to-end setup

Updated: Aug 25, 2026
Copy for LLM

Summary

This guide sets up Meta Business Agent on a WhatsApp Business phone number. It covers the end-to-end setup process including WhatsApp Manager, system user, access token, app subscription, and webhook fields. To enable the agent, you must call the Meta Business Agent Onboarding endpoint and then the Settings endpoint.

Prerequisites

Before you begin, make sure you have the following:
For an introduction to what Meta Business Agent can do and who can use it, see the Overview. To get an agent answering test messages in three API calls before you complete this setup, see the Quickstart.

Step 1: Set up Meta Business Agent in WhatsApp Manager

Set up Meta Business Agent on your eligible phone numbers in WhatsApp Manager and accept the Meta Business Agent Terms of Service.
  1. Go to WhatsApp Manager and select the correct WhatsApp Business account if prompted.
  2. Go to the Meta Business Agent tab. This tab only appears if at least one phone number in your WABA is eligible.
  3. Set up Meta Business Agent for any eligible phone numbers. This is also where you accept the Meta Business Agent Terms of Service.
  4. Your agent isn’t enabled yet — set up its knowledge and skills first (see Next steps) before enabling it.
Important: Solution Partners and Tech Providers: your client accepts the Meta Business Agent Terms of Service in WhatsApp Manager (above). You must additionally accept the Tech Provider Terms of Service (if you haven’t already done so) by becoming a Tech Provider in the Facebook Developer Portal. Meta Business Agent rejects API calls until you accept the required Terms of Service. For details, see Get started for Tech Providers.

Step 2: Set up billing

Meta charges for Meta Business Agent messages. Set up billing before you turn your agent on — messages are not delivered unless your account has a payment method attached.
Attach a payment method to your account in Billing Hub. For instructions, rates, and the list of supported currencies, see Billing for Meta Business Agent messages.

Step 3: Create a system user

Meta Business Agent Platform API requests are authenticated as a system user. If you already have a system user in Meta Business Suite, skip to Step 4.
  1. Go to Meta Business Suite.
  2. In the left navigation, select Settings.
  3. In the side navigation panel, under Users, select System users.
  4. In the upper right, click the + Add button. In the dialog that opens, enter a name, select the Admin role, and click Create system user.

Step 4: Assign the app and WABA to your system user

Assign your WhatsApp Business account (WABA) to the same system user, with phone number management permission.
  1. In Meta Business Suite, in the left navigation, select Settings. In the side navigation panel, under Users, select System users, then select your system user.
  2. In the upper right, click the three-dot menu button and click Assign Assets.
  3. In the panel that opens, select Apps, find your app, and enable the checkbox next to it.
  4. Assign the permissions that are necessary for your System User.
  5. Find your WABA, and enable the checkbox next to it.
  6. Click the slider next to View and manage phone numbers to grant the permission, and then click Assign Assets.

Step 5: Generate an access token

You can authenticate Meta Business Agent Platform API requests using either a system user token or a Business Integration System User (BISU) token, depending on your integration model. Both token types require the whatsapp_business_messaging and whatsapp_business_management permissions.
Note: Include the X-API-Version: 2.0.0 header on every Meta Business Agent Platform API request. Without it, requests default to version 1.0.0, where the Skills endpoint is unavailable (it was named instructions before version 2.0.0).

Option A: system user token for direct integrators

Use a system user token if you are integrating directly with the Meta Business Agent Platform APIs for your own WABA.
  1. In Meta Business Suite, in the left navigation, select Settings. In the side navigation panel, under Users, select System users, then click your system user.
  2. In the upper right, click Generate new token. A dialog opens.
  3. In the dialog, select your app from the dropdown, and then click Next.
  4. Select the token expiration setting, and then click Next.
  5. Click the checkboxes next to the following permissions:
    • whatsapp_business_messaging
    • whatsapp_business_management
  6. Click Generate token and save it in a secure location.

Option B: Business Integration System User (BISU) token for Solution Partners and Tech Providers

Use a Business Integration System User (BISU) token if you are a Solution Partner or Tech Provider making Meta Business Agent Platform API calls on behalf of your clients’ WhatsApp Business accounts (WABAs). A Business Integration System User (BISU) token lets your platform act on behalf of multiple client WABAs under a single credential. See the BISU documentation for details on generating and managing BISU tokens.

Step 6: Subscribe the app to the WhatsApp Business account

Subscribe your Meta app to your WhatsApp Business account so it receives webhooks for Meta Business Agent conversations.
  1. Go to the Graph API Explorer tool.
  2. Choose your app from the dropdown menu and select Get App Token. This opens a dialog to choose the Business Portfolio and the specific WhatsApp account. Make sure you choose the correct WABA.
  3. Make a POST request to /<WABA_ID>/subscribed_apps. See the Subscribed Apps API reference for details.
  4. Verify the subscription by making a GET request to /<WABA_ID>/subscribed_apps. If successful, your app ID appears in the response.

Step 7: Subscribe to webhook fields

Meta Business Agent requires three webhook fields so your app stays in sync with agent conversations.
  1. Go to the Facebook Developer Portal and click your app.
  2. In the left navigation, go to the WhatsApp tab, then go to Configuration. The configuration page opens.
  3. In the Webhook fields section, click Subscribe next to each of the following fields:

Conversation routing

When Meta Business Agent is enabled, it acts as the primary responder for a conversation and answers the WhatsApp user directly. Your app is a standby participant: it still receives the WhatsApp user’s messages, plus copies of the messages the agent sends on the business’s behalf and their delivery and read receipts, so it stays in sync.
Which webhook field a WhatsApp user’s message arrives on depends on who holds control:
Who holds controlWebhook field that receives messages
Meta Business Agent
Your app
messages
A messaging_handovers webhook notifies you whenever control changes.
To respond to a conversation, your app needs control of it. Your app takes control by sending a message to the conversation, or, if your business is configured as the escalation partner for the phone number, by calling the Thread Control (Cloud API) endpoint with the take action. To hand control back to Meta Business Agent so it resumes responding, call the same endpoint with the release action.
The endpoint also accepts a pass action, which transfers control to the escalation partner configured for the phone number, or to Meta Business Agent when you set control_pass.target_role to "ai_agent".

Release conversation control back to the agent

When your app sends a message to a conversation, it automatically takes control from Meta Business Agent. To hand control back to the agent so it resumes responding, call the Thread Control (Cloud API) endpoint with the release action.
<PHONE_NUMBER_ID> is the same WhatsApp Business phone number ID as <ENTITY_ID>; the Cloud API Thread Control endpoint just names the path parameter phone_number_id.

Request

curl -X POST "https://graph.facebook.com/v21.0/<PHONE_NUMBER_ID>/thread_control" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "X-API-Version: 2.0.0" \
  -H "Content-Type: application/json" \
  -d '{
    "messaging_product": "whatsapp",
    "action": "release",
    "to": "<CONSUMER_PHONE_NUMBER>"
  }'

Parameters

ParameterTypeRequiredDescription
phone_number_id
integer [min: 1]
Yes
WhatsApp Business account Phone Number ID (path parameter).
messaging_product
"whatsapp"
Yes
Messaging service used for the request. Must be "whatsapp".
action
"release", "pass", or "take"
Yes
The thread control action to perform. release relinquishes thread control and hands the conversation back to Meta Business Agent as the automatic responder; you must currently hold thread control. pass transfers thread control to Meta Business Agent when control_pass.target_role is "ai_agent", or to the escalation partner configured for this phone number when control_pass is omitted; you must currently hold thread control. take acquires thread control from the current owner and is restricted to the configured escalation partner.
to
string
No
WhatsApp user’s phone number or WhatsApp ID whose thread control is being transferred. The API does not mark this field required, but you must identify the consumer, so provide to.
recipient
string
No
Business-scoped user ID of the WhatsApp user whose thread control is being transferred. Accepted but not yet wired; provide to instead.
metadata
string [max: 2000]
No
Free-form string forwarded verbatim to the receiving app in the resulting messaging_handovers webhook.
control_pass
object
No
Configuration for a pass action. When omitted, pass uses the configured escalation partner. Contains one required field, target_role, whose only accepted value is "ai_agent" — which selects Meta Business Agent as the recipient of control.

Response

{
  "messaging_product": "whatsapp"
}
The response confirms the action completed. After releasing control, Meta Business Agent resumes as the primary responder for the conversation. Your app continues receiving messages on the standby webhook field instead of the messages field.

When to release control

Release control when:
  • Your human agent resolves the customer’s issue and no further action is needed
  • You want the AI agent to handle routine follow-ups automatically
  • The conversation requires capabilities the agent provides (product recommendations, FAQ responses)
Your app retains control until you explicitly release it. Stopping message sends does not release control — you must call this endpoint.

Take control of a conversation

Sending a message to a conversation takes control implicitly. Use the take action to take control before you send anything — for example, to stop Meta Business Agent from replying while a human agent reads the conversation history and composes a response.
The take action is restricted to the business configured as the escalation partner for the phone number. Other apps and businesses receive an error; they take control implicitly by sending a message instead.

Request

curl -X POST "https://graph.facebook.com/v21.0/<PHONE_NUMBER_ID>/thread_control" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "X-API-Version: 2.0.0" \
  -H "Content-Type: application/json" \
  -d '{
    "messaging_product": "whatsapp",
    "action": "take",
    "to": "<CONSUMER_PHONE_NUMBER>",
    "metadata": "Human agent stepping in"
  }'

Parameters

ParameterTypeRequiredDescription
phone_number_id
integer [min: 1]
Yes
WhatsApp Business account Phone Number ID (path parameter).
messaging_product
"whatsapp"
Yes
Messaging service used for the request. Must be "whatsapp".
action
"take"
Yes
The thread control action to perform. Acquires thread control from the current owner.
to
string
No
WhatsApp user’s phone number or WhatsApp ID whose thread control is being transferred. The API does not mark this field required, but you must identify the consumer, so provide to.
metadata
string [max: 2000]
No
Free-form string forwarded verbatim to the receiving app in the resulting messaging_handovers webhook.

Response

{
  "messaging_product": "whatsapp"
}
The response confirms the action completed. Your app now holds thread control: Meta Business Agent stops responding, and the WhatsApp user’s messages arrive on the messages webhook field instead of standby.

Outcomes by current owner

Owner before the callOwner after the callResult
Meta Business Agent
Escalation partner
Control transfers. The agent stops responding.
Another app
Escalation partner
Control transfers.
No one (idle conversation)
Escalation partner
Control is acquired.
Escalation partner (you)
Escalation partner
No change.

Handover webhook

When control transfers, the app that lost control receives a control_taken webhook on the messaging_handovers field. This webhook goes only to the app that lost control, not to every app subscribed to the WhatsApp Business account.
{
  "type": "control_taken",
  "control_taken": {
    "previous_owner_app_id": "<APP_ID>",
    "new_owner_app_id": "<APP_ID>",
    "new_owner_business_id": "<BUSINESS_ID>",
    "metadata": "Human agent stepping in"
  }
}
Release control with the release action when you’re done, so Meta Business Agent resumes as the primary responder.

Next steps: configure and run your agent

Your app is connected! Set up your agent in three stages: Onboard, Configure, and Operate.
At minimum, call Onboarding, then Settings to turn an agent on. These two calls are the basic configuration required to enable an agent. You can also populate its knowledge base, connectors, or both, depending on your use case.

Onboard

Use these APIs to check eligibility, turn your agent on or off, onboard, and manage your agent.
EndpointUse it to
Check whether a WhatsApp Business phone number can use Meta Business Agent.
Prepare the agent on a phone number — creates its configuration and knowledge. Required step before turning the agent on.
Turn the agent on or off, and set its behavior, persona, language, and handoff and followup policies. Required to turn the agent on — enabling makes it start responding to new conversations.
Limit the agent to a specific set of consumer phone numbers — useful for a controlled rollout. Only takes effect when ai_audience is set to ALLOWLISTED_ONLY in Settings. See Restrict the agent to a set of consumers.

Restrict the agent to a set of consumers

Adding consumers to the allowlist does not by itself limit who the agent replies to. The allowlist is only enforced when the ai_audience setting is ALLOWLISTED_ONLY. The default is EVERYONE, so an agent enabled without changing ai_audience responds to every consumer who messages your business, regardless of what the allowlist contains.
To restrict the agent, do both of the following before you enable it:
  1. Add each consumer to the allowlist with POST /{entity_id}/agent_config/allowlist, passing consumer_phone_number in E.164 format, for example +15551234567. Add one consumer per call, and list the current entries with GET /{entity_id}/agent_config/allowlist.
  2. Set ai_audience to ALLOWLISTED_ONLY with PUT /{entity_id}/agent_config/settings, then read the setting back with GET /{entity_id}/agent_config/settings to confirm the change applied.
Only after both calls succeed should you set rollout.enabled to true. This ordering matters when you are testing against a live WhatsApp Business phone number, because enabling the agent first exposes it to real conversations.
ai_audience valueWho the agent responds to
EVERYONE (default)
All consumers. The allowlist is ignored.
ALLOWLISTED_ONLY
Only consumers in the allowlist.
Remove a consumer with DELETE /{entity_id}/agent_config/allowlist/{entry_id}.

Configure

Shape what your agent knows and what it can do.
EndpointUse it to
Give the agent system instructions that shape how it responds.
Add business details, such as hours, locations, and policies, that the agent can reference.
Add question-and-answer pairs to the agent’s knowledge base.
Add website URLs for the agent to crawl and reference.
Upload files as knowledge sources.
Define an external API the agent can call, so it can do more than answer questions.
Define the individual operations available on a connector.

Operate

Run your agent in live conversations, then test and measure it.
EndpointUse it to
Take control of a conversation, or release control back to the agent.
Trigger an agent action for a conversation in response to a business event, such as a completed purchase.
Send test messages to the agent for automated testing.
Evaluate the agent’s performance.
Review which knowledge sources and skills the agent uses in its responses.

Product catalog

Meta Business Agent uses your Meta product catalog for product information — manage your products in Meta Commerce Manager.