> For the complete documentation index, see [llms.txt](https://docs.360dialog.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.360dialog.com/docs/mba/meta-business-agent/4.-test-your-agent.md).

# 4. Test your Agent

Before customers reach your agent, send it test messages and check the replies. The test endpoint returns the agent's response plus useful diagnostics — no real WhatsApp message is sent.

```bash
curl -s -X POST https://waba-v2.360dialog.io/agent_test \
  -H "D360-API-KEY: <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{ "user_msg": "Do you deliver to Rio?" }'
```

[Run an agent test](/docs/mba/api-ref/operate/run-an-agent-test.md)

{% hint style="info" %}
**A 4XX or 500 from `agent_test` isn't always a real error.** Endpoints occasionally fail with no obvious cause while Meta debugs an ongoing instability. Retry after a few hours before treating it as a configuration problem. See [Known limitations](/docs/mba/meta-business-agent/known-limitations.md#platform-stability).
{% endhint %}

The response includes `agent_response` (the reply text), `conversation_id`, `handoff_reason`, `no_response_reason`, `quick_replies`, and `product_variant_ids`.

## How to test safely today

Because of the caveat above, the practical way to test before a public launch is to **test on real WhatsApp under an allowlist**, not through `agent_test`:

1. Set `ai_audience` to `ALLOWLISTED_ONLY` and add your own phone numbers to the [allowlist](/docs/mba/meta-business-agent/5.-go-live.md).
2. Message the agent from those allowlisted numbers on WhatsApp and observe the replies directly on the phone.
3. Iterate on skills, FAQs, and business info, then repeat.

Use `agent_test` for quick automated checks in environments where it's acceptable to have the agent on `EVERYONE` (for example, a dedicated test number), and use the allowlist-on-real-WhatsApp method for pre-launch validation of a production number.

{% hint style="info" %}
**Each `agent_test` call starts a fresh conversation** unless you pass a `conversation_id` back in to continue a thread. The consumer/`to` field is ignored. So to test a multi-turn flow, capture the `conversation_id` from the first response and send it with the next message.
{% endhint %}

{% hint style="success" %}
**You can watch a live agent conversation over webhooks.** While the agent holds a conversation, the consumer's messages and the agent's replies arrive on the `standby` field of your number's webhook, alongside `messaging_handovers` and `bizai`-tagged delivery statuses. This makes allowlist testing on real WhatsApp observable end to end — see [Webhooks](/docs/mba/webhooks.md)
{% endhint %}

Once you're happy with the replies, continue to [Go live with an allowlist](/docs/mba/meta-business-agent/5.-go-live.md).

{% hint style="info" %}
**Want to see exactly why the agent replied the way it did?** Once you've sent a test message, look up that conversation's turns — including which tools were called and how long each step took — in [Controlling your Agent.](/docs/mba/meta-business-agent/controlling-your-agent.md)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.360dialog.com/docs/mba/meta-business-agent/4.-test-your-agent.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
