> 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, and no consumer phone number is needed.

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

[Run an agent test](https://docs.360dialog.com/docs/mba/api-ref/operate/run-an-agent-test.md)

{% hint style="success" %}
**`agent_test` works before you go live.** You don't need to switch the agent to `EVERYONE` to get real replies — test right after configuring, and keep testing while the agent runs on an allowlist. (Earlier, `agent_test` only replied once the agent was fully published; that's no longer the case.)
{% endhint %}

The response includes:

* `agent_response` — the reply text.
* `conversation_id` — pass it back to continue the same conversation.
* `quick_replies` — suggested replies the agent offered.
* `product_variant_ids` — catalog products the reply referenced.
* `handoff_reason` — set when the agent decided to hand off to a human.
* `no_response_reason` — set when the agent produced no reply, with the reason.

## Test multi-turn conversations

**Each `agent_test` call starts a fresh conversation** unless you pass a `conversation_id` back in. To test a multi-turn flow, capture the `conversation_id` from the first response and send it with the next message:

```bash
curl -s -X POST https://waba-v2.360dialog.io/agent_test \
  -H "D360-API-KEY: <YOUR_API_KEY>" \
  -H "X-API-Version: 2.0.0" \
  -H "Content-Type: application/json" \
  -d '{ "user_msg": "And how long does it take?", "conversation_id": "<CONVERSATION_ID>" }'
```

## See why the agent replied the way it did

Pass the test's `conversation_id` to [Conversation turns](https://docs.360dialog.com/docs/mba/meta-business-agent/controlling-your-agent.md#conversation-turns) as `user_phone_number` to see every step behind the reply — which tools were called with what input and output, and how long each step took.

## What to test

Don't stop at the happy path. Before going live, try to break it:

* **Questions it can't answer** — it should say so or hand off, not invent an answer.
* **Out-of-scope requests** — off-topic questions, competitors, requests for things you don't sell.
* **Conflicting instructions** — messages that try to get it to ignore its skills or say things it shouldn't.
* **Connector failures** — slow or empty responses from your own APIs.
* **Unexpected input** — typos, other languages, very long messages, long conversations.
* **Handoff** — confirm it hands off when it should, and that someone picks up.

## Run scored evaluations

For repeatable checks, use **Agent Eval**: define test scenarios with success criteria, run them as a job, and get a score per conversation plus a summary of the most common failures. Rerun the same cases after every configuration change to catch regressions.

* [List evaluation cases](https://docs.360dialog.com/docs/mba/api-ref/operate/list-evaluation-cases.md)
* [Run an evaluation job](https://docs.360dialog.com/docs/mba/api-ref/operate/run-an-evaluation-job.md)
* [Get evaluation job status](https://docs.360dialog.com/docs/mba/api-ref/operate/get-evaluation-job-status.md)

## Test on real WhatsApp

`agent_test` covers the agent's logic. Before opening the agent to everyone, also message it from your own phone under an allowlist, to see the real experience: interactive messages, media, handoff to your team and delivery. See [Go live with an allowlist](https://docs.360dialog.com/docs/mba/meta-business-agent/5.-go-live.md).

{% 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 `bizai`-tagged delivery statuses. See [Webhooks](https://docs.360dialog.com/docs/mba/webhooks.md).
{% endhint %}

{% hint style="info" %}
**Rate limit.** Meta limits `agent_test` to about 500 requests per hour per phone number. Over the limit you get `429 Too Many Requests` until it resets.
{% endhint %}

Once you're happy with the replies, continue to [Go live with an allowlist](https://docs.360dialog.com/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 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.
