> ## Documentation Index
> Fetch the complete documentation index at: https://docs.teamfollowup.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use the public API base URL: https://api.teamfollowup.ai/api.
> Authenticate public API requests with Authorization: Bearer YOUR_API_KEY.
> Use product-owned terms: agents, campaigns, projects (GoHighLevel sub-accounts), contacts, calls, outcomes, skills, cadences, phone numbers.
> Scope requests by locationId rather than projectName.
> Read the guide linked from each API reference group before recommending an endpoint.

# Test your agent

> Three ways to hear your agent before a lead does: talk to it in the browser, have it phone you, or push a test contact through the real campaign entry.

Never let a lead be the first person to hear a new agent. There are three ways
to test, and they check different things. Use them in this order.

## Prerequisites

* An agent, with its prompt and voice set. See [Quickstart](/quickstart).
* A payment method on your agency wallet. Test minutes bill exactly like real
  minutes, and the phone and browser tests refuse to start without one.
* For the phone tests, a number on the campaign. See
  [Phone numbers and caller ID](/phone-numbers/overview).
* An API key with `calls:write` for the phone and browser tests, and
  `agents:write` for the campaign test run.

## Step 1: Talk to it in the browser

The quickest loop for prompt work. No number, no phone, no lead data.

Call [Start a web test session](/api-reference/agents/start-a-web-test-session)
for the agent. The response carries `accessToken`, `callId` and `agentName`.
The token opens a live browser conversation with the agent, using the agent's
own prompt and begin message untouched. In the dashboard, this is the **Talk
now** button on the agent, which handles the token for you.

Because there is no lead, the lead-specific variables in the prompt are empty.
That is expected. You are checking tone, flow and how the agent handles
objections, not personalisation.

A `409` means a billing gate: no payment method, a depleted wallet, or a halted
project. The message says which. A `502` means the voice provider refused to
start the session and nothing is wrong with the agent.

## Step 2: Have it phone you

This is what a lead will hear, on a real line, from the campaign's caller ID.

Call [Create test call](/api-reference/agents/create-test-call) with:

* `toNumber`: your phone, in E.164.
* `fromNumber`: one of the campaign's numbers.
* `contact`: optional stand-in lead data, such as a name, so the prompt's
  variables fill in the way they will on a real call.
* `locationId` and `campaignId` when the agent serves more than one campaign.

Listen for latency, how the voice sits on a phone line, and whether the
background sound reads as an office or as noise. Then pull the
[call record](/calls/overview) and read the transcript, the outcome and the
AI-generated fields the agent recorded.

## Step 3: Run a campaign test run

The two tests above call the agent directly. They skip the campaign: the
trigger tag, the calling window, the dispatch mode, the workflow. A **campaign
test run** pushes one contact through the real entry, as if the trigger tag had
just landed on them in GoHighLevel.

1. Call [Create campaign test run](/api-reference/agents/create-campaign-test-run)
   with a `contactId` from the sub-account, or a `contact` object to create one,
   and `callerPhone`, the number the agent should dial. Set `agentTest: true` to
   mark the resulting call as a test.
2. The response carries an intent id. Poll
   [Get campaign test run status](/api-reference/agents/get-campaign-test-run-status)
   with it. `consumed` turns true when the campaign has picked the contact up,
   `events` lists what happened, `triggerKind` says which entry fired, and
   `placementFailure` explains it when no call was placed.
3. Check the outcome did the CRM work you expect: the tag, the stage, the note.
   See [Campaign workflows](/campaign-workflows/overview).

If the calling window is closed, the test run parks like any other lead. Either
widen the window for the test or wait for it to open. See
[Calling window](/campaigns/calling-window).

## Keep your test calls out of the numbers

Mark your own number as internal so your tests do not drag down the booking
rate you show clients. Call [Mark contact internal](/api-reference/contacts/mark-contact-internal)
with your `phoneNumber` and the project's `locationId`. The calls stay in the
record and out of the figures. See [Contacts and leads](/contacts/overview).

## Next steps

* [Go live](/campaigns/going-live) once the test run does what you expect.
* [Run a split test](/split-testing/run-a-split-test) when you want to know
  which of two versions leads prefer.
