v2.0 · Mar 2026
BuildAI School

GHL API
Guide

The Complete Guide to GoHighLevel API Development

413+Endpoints
39API Domains
13Chapters
One-Click Export to Make.com n8n & GHL Workflows Built-in AI Assistant Free Skill File
By Julius Guevarra (Jenius with a J)
CTO · AI SaaS Builder · GHL Expert · buildaischool.com
Navigation

Table of Contents

Chapter 1

Introduction

This guide provides everything you need to connect to the GoHighLevel (GHL) API, build powerful automations, and offer premium API integration services to clients. Whether you're an agency owner, automation builder, or AI SaaS developer — this is the definitive guide to mastering the GHL API.

🆕 New in V2: The GHL API Playground
This guide now comes with a companion tool: the GHL API Playground at ghl-api-playground.buildaischool.com. Test any of the 413+ endpoints live, export to Make/n8n/GHL Workflows in one click, and use the built-in AI Assistant.

What You'll Achieve

  • Understand the difference between webhooks and APIs
  • Set up webhook receivers across multiple platforms
  • Implement core GHL API calls across all 39 domains
  • Build cost-effective automation solutions using Make, n8n, and Supabase
  • Use the GHL API Playground to test 413+ endpoints interactively
  • Leverage the built-in AI Assistant to diagnose errors and generate code
  • Command premium pricing (P50K+ per client) for your API expertise

Your Toolkit

ToolWhat It DoesCost
GHL API PlaygroundInteractive API testing, one-click exports, AI AssistantFree
GHL API Skill FileComplete API reference for Claude, ChatGPT, or any AIFree (signup)
Make.comNo-code automation platformFree 1K ops/mo
n8nWorkflow automation (best for API work)Free 1K execs/mo
SupabaseBackend + Edge Functions for custom appsFree tier
AirtableDatabase + scripting for GHL data syncFree w/ automations
Chapter 2

Understanding Webhooks vs APIs

The Simple Analogy

🤖 Webhook = Robot Friend

A robot that only moves when someone tells it to. Your friend watches for something to happen, then tells the robot to move. GHL sends data TO your endpoint when something happens.

🥤 REST API = Vending Machine

When you want a snack, YOU press the buttons and the machine responds. YOUR system asks GHL for data, and GHL sends back the response.

Technical Difference

WebhookREST API
DirectionOne-way: GHL pushes data to youTwo-way: You request, GHL responds
TriggerEvent-driven (contact created, message received)On-demand (you call when needed)
Use CaseReal-time notifications, event loggingCRUD operations, data sync, automation
SetupConfigure URL in GHL WorkflowAuth token + HTTP request
When to use which?
Use webhooks for real-time reactions (new contact, inbound message, appointment booked). Use the API to fetch data, create records, or trigger actions on your schedule.
Chapter 3

Essential Tools and Setup

Platform Comparison

PlatformFree TierAI IntegrationAPI EaseBest For
Make1,000 ops/moEasyHighBeginners
n8n1,000 execs/moMediumBestAPI work
Zapier100 tasksEasyLowSimple zaps
Supabase500K invocationsExcellentDev-levelCustom apps
BuildShip3,000 creditsBuilt-inMediumAI workflows
Airtable100 automationsNoneScriptsDatabase sync

Recommended Setup

🌱 For Beginners
1
Make.com
Primary Automation — free 1,000 ops/mo
2
Airtable
Database — free with automations
3
GHL API Playground
Testing — free, no setup required
⚡ For API Developers
1
n8n
Best JSON handling, visual debugging
2
Supabase Edge Functions
Serverless backend, low latency
3
Playground + AI Assistant
Test + AI-powered diagnostics
4
GHL API Skill File
Upload to Claude or ChatGPT
Chapter 4

Reading Webhook Data

Setting Up Your First Webhook

In Make.com
1
Create a new scenario
2
Click + → Webhooks → Custom webhook
3
Click "Add", name it "GHL API Test", copy URL
In n8n
1
Add a "Webhook" trigger node
2
Set method to POST
3
Copy the webhook URL

Configure GHL + Test

1
Create Workflow
GHL → Automations → Create Workflow → Start from scratch
2
Add Webhook Action
Click + icon, type "web", select "Webhook", paste your URL
3
Test Workflow
Click "Test Workflow", select any contact, check your webhook platform

Webhook Payload Example

JSON Payload
{
  "contact_id": "102goXVW3lIExEQPOnd3",
  "first_name": "John",  "last_name": "Doe",
  "email": "john@example.com",
  "phone": "+123456789",
  "tags": ["tag1", "tag2"],
  "location": { "id": "502goXVW3lIExEQPOnd3", "name": "Your Location" },
  "custom_fields": [],
  "date_added": "2024-06-06T18:54:57.221Z"
}

Key Fields

  • contact_id — Never changes, always unique. Use for DB storage and API lookups.
  • location.id — Required for most API calls. Your sub-account identifier.
  • tags — Array of strings. Only tag names needed for add/remove (not IDs).
  • custom_fields — Only shows actual custom fields, NOT standard contact fields.
⚠️ Common GHL Naming Confusion
GHL's Custom Fields UI shows BOTH custom fields AND contact fields (like Business Name, Street Address). Contact fields are NOT custom fields. Custom fields are ones YOU create.
Chapter 5

GHL API Fundamentals

Base URL

https://services.leadconnectorhq.com

Required Headers (Every Request)

🔴 Version Header is REQUIRED
Every GHL API request must include Version: 2021-07-28. Missing it causes 400 Bad Request errors. This is the most common mistake beginners make.
Request Headers
Authorization: Bearer YOUR_ACCESS_TOKEN
Version: 2021-07-28
Content-Type: application/json

Rate Limits

⚡ Burst Limit
100 requests per 10 seconds per app per resource
📅 Daily Limit
200,000 requests per day per app per resource
📊 Monitor Headers
x-ratelimit-limit
x-ratelimit-remaining
x-ratelimit-reset
🔄 On 429 Error
Exponential backoff: 1s → 2s → 4s → 8s → 16s
Chapter 6

Authentication: Private Integration

The simplest way to connect to the GHL API. Use this for single-account solutions and quick implementations.

When to Use

  • Working with just one GHL sub-account
  • Quick prototyping and testing
  • Basic CRM operations (contacts, tags, notes, opportunities)
  • You do NOT need custom conversation provider functionality

Step-by-Step Setup

1
Create the Integration
GHL Sub-account → Settings → Integrations → Private Integrations → Create New → Name it → Select scopes
2
Generate & Store Your API Key
Click "Create" → IMMEDIATELY copy and securely store the key. Valid for 90 days.
🔑 CRITICAL: Copy the token immediately!
The token is shown ONLY ONCE. Store it in your password manager. If you lose it, you must create a new integration.

Recommended Scopes

Use CaseScopes
Basic CRM
contacts.readonlycontacts.write
Full Contact Management
contacts.*locations/customFields.*locations/tags.*
Calendar / Appointments
calendars.*calendars/events.*
Pipeline / Opportunities
opportunities.readonlyopportunities.write
Messaging
conversations.*conversations/message.*

Token Management

⏱ Validity
90 days from creation
🔄 Rotation
Set reminder for day 85 to regenerate
🔁 Update
Update ALL connected automations immediately
✏️ Scope Changes
Take effect immediately without reinstallation
🏢 Advanced: Modular Token Architecture
For enterprise: separate tokens for scope groups — Token 1: Contacts + Custom Fields | Token 2: Calendars + Opportunities | Token 3: Tasks + Tags + Workflows. Provides fault isolation and better security.
Chapter 7

Authentication: OAuth 2.0

OAuth provides greater flexibility for multi-account access, custom conversation providers, and marketplace apps.

OAuth vs Private Integration

FeatureOAuthPrivate Integration
Token expiry24 hours (auto-refresh)90 days (manual rotation)
Multi-accountYesNo (single sub-account)
Conversation providersSupportedNot supported
Setup complexityHigher (Marketplace app)Lower (Settings → Integrations)
Scope changesRequires reinstallationInstant

Step-by-Step Setup

1
Create a Marketplace App
Agency account → app.gohighlevel.com/marketplace → App Dashboard → Create App → Set Privacy: "Private", Distribution: "Agency and Sub Account"
2
Configure Authorization
App Settings → Authorization → Select scopes → Add redirect URL → Save
3
Generate Client Keys
Client Keys section → Click "Add" → Save both Client ID and Client Secret securely
4
Exchange Code for Token
POST to /oauth/token with client credentials. Returns: access_token, refresh_token, locationId
5
Set Up Token Refresh
OAuth tokens expire after 24 hours. Refresh every 20–22 hours. Old refresh_token is invalidated after use.
Token Exchange
POST https://services.leadconnectorhq.com/oauth/token
Content-Type: application/x-www-form-urlencoded

client_id=YOUR_CLIENT_ID
client_secret=YOUR_CLIENT_SECRET
grant_type=authorization_code
code=RECEIVED_CODE
user_type=location
🔄 Refresh Schedule
Run token refresh every 20–22 hours (before the 24h expiry). Store both the new access_token AND new refresh_token. The old refresh_token becomes invalid after use.
Chapter 8

Troubleshooting Common Issues

Error Reference

ErrorCauseFix
401Token invalid or expiredRefresh OAuth token or regenerate Private Integration key. Verify 'Bearer' prefix.
400Missing Version headerAdd 'Version: 2021-07-28' to every request.
403Insufficient permissionsCheck token scopes. For OAuth, verify token is for the correct location.
422Missing required fieldsCheck locationId, contactId, and all required body fields.
429Rate limitedImplement exponential backoff. Max 100 req/10s, 200K/day.

Exponential Backoff Implementation

JavaScript
async function makeRequestWithRetry(apiCall, maxRetries = 5) {
  for (let attempt = 1; attempt <= maxRetries; attempt++) {
    try {
      return await apiCall();
    } catch (error) {
      if (error.status !== 429 || attempt === maxRetries) throw error;
      const delay = Math.pow(2, attempt - 1) * 1000;
      await new Promise(r => setTimeout(r, delay));
    }
  }
}
🤖 Use the AI Assistant for Error Diagnosis
In the GHL API Playground, click "Explain Error" on any failed request. The AI reads your request, response, and endpoint context, then tells you exactly what went wrong and how to fix it.
Chapter 9

The GHL API Playground

A free, interactive API explorer built specifically for GoHighLevel. Replaces static endpoint tables with a live, testable, exportable interface.

What the Playground Gives You

🔌 413+ Endpoints
All 39 GHL API domains covered
⚡ Live Testing
Paste your token, select endpoint, hit Send
📋 Auth Docs Inline
Required scope, token type, headers on every endpoint
📤 One-Click Export
Export to Make.com, n8n, and GHL Workflows instantly

The AI Assistant

Sign up (free) to unlock a built-in AI Assistant that knows every GHL endpoint. Bring your own API key from Anthropic, OpenAI, or Google.

  • Ask anything: "How do I send an SMS?" → get exact endpoint, body, scope, and code example
  • Explain errors: Click "Explain Error" on any 4xx/5xx for instant AI-powered diagnosis
  • Natural language search: Type what you want to do, AI finds the right endpoint

The GHL API Skill File

Claude
Projects → Project Knowledge → Upload
ChatGPT
Explore GPTs → Create → Knowledge → Upload
Any AI Tool
Paste as context or upload as a knowledge file

All 39 API Domains

Contacts
Conversations
Calendars
Opportunities
Locations
Users
Workflows
Payments
Invoices
Products
Businesses
Companies
Custom Objects
Associations
Custom Fields V2
Forms
Funnels
Campaigns
Blogs
Surveys
Courses
Snapshots
Social Planner
Email
LC Email (ISV)
Media Storage
Trigger Links
Custom Menus
Voice AI
Phone System
SaaS
Store
Proposals/Docs
Marketplace
Brand Boards
Knowledge Base
Chapter 10

Platform-Specific Implementations

n8n (Recommended for API Work)

Superior for GHL API work: clean JSON handling with visual data mapping, downloadable output bundles for debugging, no complex auth setup, and Table/Schema view of API responses.

⚡ Setup with the Playground
Click "n8n — Workflow Import" on any endpoint. Paste JSON into n8n's import dialog. HTTP Request node comes pre-configured with URL, method, headers, and body.

Make.com

🔵 Setup with the Playground
Click "Make.com — Blueprint Import" on any endpoint. Import directly into Make. HTTP module comes pre-configured.

Manual Configuration

1
Add HTTP → Make a Request module
2
Set method and URL for the endpoint
3
Toggle Map OFF for headers, add: Accept, Authorization, Content-Type, Version
4
Set Body Type to Raw, Content Type to JSON

Airtable Run Script

Airtable Scripting Automation
const config = input.config();
const ghlApiKey = input.secret('GHL_Token');
const body = {
  locationId: 'YOUR_LOCATION_ID', page: 1, pageLimit: 1,
  filters: [{ field: 'id', operator: 'eq', value: config.id }]
};
const response = await fetch('https://services.leadconnectorhq.com/contacts/search', {
  method: 'POST',
  headers: { 'Authorization': `Bearer ${ghlApiKey}`,
             'Content-Type': 'application/json', 'Version': '2021-07-28' },
  body: JSON.stringify(body)
});
const result = await response.json();
output.set('response', result);
🔐 Store your token in Airtable Secrets
Go to Secrets in your Airtable automation script. Click 'Add new secret'. Reference it with input.secret('GHL_Token'). Never hardcode tokens in scripts.
Chapter 11

Custom Conversation Provider Integration

🔐 OAuth Required
Custom conversation providers REQUIRE OAuth authentication. Private Integration tokens cannot be used for this feature.

SMS Cost Reduction Strategy

ProviderCost/Segment100K Segments/Month
Twilio (default)~$0.0075$750/month
Bandwidth/Wavix~$0.0040$400/month
Savings47% reduction$350+/month

Key API Endpoints

Update Message Status

PUT /conversations/{conversationId}/messages/{messageId}

{
  "status": "delivered",
  "conversationProviderId": "{{conversationProviderId}}"
}

Add Inbound Message

POST /conversations/messages/inbound

{
  "conversationId": "{{conversationId}}",
  "message": "{{messageText}}",
  "conversationProviderId": "{{conversationProviderId}}",
  "date": "{{timestamp}}"
}

Search Conversation

POST /conversations/search

{ "query": { "contactId": "{{contactId}}", "types": ["sms"] } }
💰 Monetization Opportunity
Consider a revenue-share model. Client saves $350/month on SMS, you receive 10–20% ($35–70/month recurring). This is the kind of implementation that commands P50K+ per project.
Chapter 12

Location ID: The Critical Parameter

Your Location ID is the sub-account identifier required for nearly every GHL API call.

Finding Your Location ID

1
Method 1: From the URL
Look at your GHL sub-account URL in the browser
https://app.gohighlevel.com/location/Ve4dRjwzx2ZkQQBFaduX/dashboard
                                          ↑ This is your Location ID
2
Method 2: From Webhook Data
Every webhook payload includes the location object with the ID
"location": {
  "id": "Ve4dRjwzx2ZkQQBFaduX",
  "name": "Your Location"
}
3
Method 3: From the Playground
Your Location ID is visible in the response of any endpoint you test in the GHL API Playground
🔄 Dynamic Location ID Strategy
For multi-location automations, extract the locationId from webhook data rather than hardcoding it. This makes your automations portable across sub-accounts.
Chapter 13

What's Next

Your Learning Path

1
Start with the Playground
Open ghl-api-playground.buildaischool.com, paste your token, and test your first endpoint
2
Download the Skill File
Sign up to get the GHL API Skill File and upload it to Claude or ChatGPT for instant expertise
3
Activate the AI Assistant
Add your Claude, GPT, or Gemini API key to get AI-powered help inside the Playground
4
Build Your First Automation
Use one-click export to create a working Make or n8n scenario in seconds
5
Join the BuildAI School Community
API Accelerator recordings, advanced workshops, and the full 25-lesson curriculum

BuildAI School Community

📹 API Accelerator
5 workshop sessions covering webhooks to custom conversation providers
🔗 Advanced Integrations
Airtable sync, BuildShip workflows, custom SMS providers
📚 Full Curriculum
25 lessons across 5 phases: project setup to production deployment
💬 Live Support
Ask questions, share projects, get feedback from the community

Resources

ResourceLink
GHL API Playgroundghl-api-playground.buildaischool.com
BuildAI Schoolbuildaischool.com
Official GHL API Docsmarketplace.gohighlevel.com/docs/
GHL OpenAPI Specsgithub.com/GoHighLevel/highlevel-api-docs
GHL Developer Communitydevelopers.gohighlevel.com/join-dev-community
BuildAI School

GHL API Guide

Master GoHighLevel's complete API — from your first webhook to advanced OAuth implementations, custom conversation providers, and premium client projects worth P50K+.

GHL API Playground
ghl-api-playground.buildaischool.com
BuildAI School
buildaischool.com
Official GHL API Docs
marketplace.gohighlevel.com/docs/

"We don't just teach the API. We give you the tools to master it."
— Julius Guevarra · BuildAI School