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.
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?" }'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.
The response includes agent_response (the reply text), conversation_id, handoff_reason, no_response_reason, quick_replies, and product_variant_ids.
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.
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:
Set
ai_audiencetoALLOWLISTED_ONLYand add your own phone numbers to the allowlist.Message the agent from those allowlisted numbers on WhatsApp and observe the replies directly on the phone.
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.
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.
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
Once you're happy with the replies, continue to Go live with an allowlist.
Last updated
Was this helpful?