> 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`.

{% hint style="danger" %}
**Big caveat today: `agent_test` only works when the agent is fully published.** The test endpoint returns a real reply only when the agent's `rollout` is **enabled** *and* `ai_audience` is **`EVERYONE`**. If the audience is `ALLOWLISTED_ONLY`, the test returns an **empty** `agent_response` with `no_response_reason = ELIGIBILITY_CHECK_FAILED` — even for numbers on your allowlist.

In other words, to test via this endpoint you currently have to open the agent to everyone first, which defeats the point of testing before launch. **We've raised this with Meta and expect it to change** so testing works under an allowlist. Until then, see the workaround below.
{% endhint %}

## 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).


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
