Skip to main content
By the end of this page one agent will call every new lead in a sub-account the moment your CRM tags them. Five requests. Everything here can also be done from the dashboard, and the pages linked from each step show where.

Prerequisites

  • A GoHighLevel sub-account connected as a project. In the dashboard that is Projects. See Agencies, projects and sub-accounts.
  • An API key with the agents:write, phone_numbers:write and calls:write scopes, created under API Keys in the dashboard. See Authentication.
  • A payment method on your agency wallet. Numbers and minutes are paid.
  • A phone you can answer.
Every request below carries the bearer header and goes to the base URL described in Conventions.

Step 1: Find the project’s locationId

Almost every request is scoped to a project by its locationId, the GoHighLevel location id. List campaign projects returns the projects that can hold campaigns. Pick the one you want.
Copy the locationId of your project.

Step 2: Create the agent and its campaign

One request to Create agent creates the agent, its prompt, and the campaign that decides who it calls and when.
The response is the agent, with its id, the config as stored, and the campaign under campaign. The campaign is created paused, with active: false. Nothing dials yet. If part of the setup could not be applied, partialFailures says which part. Keep the agent id. Every request below uses it.

Step 3: Give it a number

The campaign needs a caller ID. Search agent phone numbers for a local number, then buy it for the agent.
Buying is a paid action. The number lands in your agency’s pool and on the campaign’s fromNumbers. If you already own numbers in Twilio, attach one of those instead. See Phone numbers and caller ID.

Step 4: Hear it call you

Before a lead hears the agent, you should. Call Create test call:
Your phone rings from the campaign’s number and the agent runs its prompt. Add a contact object with stand-in lead details if you want the prompt’s variables filled in. The response carries the callId. When you hang up, read the record:
You get the transcript, the outcome, and the details the agent captured. See Test your agent for the browser test and the full campaign test run.

Step 5: Switch it live

One field on Update campaign:
From now on, tag a contact new_lead in the sub-account and the agent calls them, inside the campaign’s calling window. The response carries callingWindow. If the default hours do not suit the business, set them before you go live. See Calling window.

What you built

Next steps