How to read a scope name
A name has two parts. Like contacts.write — contacts = what you touch, write = what you can do. readonly = look only.
What each scope does. Who it's for. Read-only or write. How to use the API in Claude, Antigravity, or your own app. And the limits.
A name has two parts. Like contacts.write — contacts = what you touch, write = what you can do. readonly = look only.
GHL Megaminds helps you integrate GoHighLevel and build custom wrappers around it.
Four guides. Start at the top. Each one is short.
First you need a key. We call it a token. Then the API will listen to you.
Way A: Private token. (Easy. For your own account.)
Use it in a request header:
curl https://services.leadconnectorhq.com/contacts/v1/contacts \
-H "Authorization: Bearer YOUR_TOKEN"
Way B: OAuth 2.0. (For apps other people install.)
curl -X POST https://services.leadconnectorhq.com/oauth/token \
-d grant_type=authorization_code \
-d code=THE_CODE_YOU_GOT \
-d client_id=YOUR_CLIENT_ID \
-d client_secret=YOUR_CLIENT_SECRET
GHL has its own MCP server. That is the clean way to hook Claude up.
MCP is a standard way for AI to use tools. The AI asks, the server does the work. Claude only does what the scopes you approved allow.
On Claude.ai:
https://services.leadconnectorhq.com/mcp/anthropic/v2In Claude Code (terminal):
claude mcp add --transport http leadconnector \
https://services.leadconnectorhq.com/mcp/anthropic/v2
Then type /mcp to see it. For ChatGPT and other OpenAI tools, GHL has a
matching endpoint: https://services.leadconnectorhq.com/mcp/openai/v2/
Antigravity is Google's AI coding app. Two ways to work.
Way A: Add GHL's MCP server.
https://services.leadconnectorhq.com/mcp/anthropic/v2Way B: Let the agent write the code.
.env in your project:# .env
GHL_TOKEN=your_private_token
GHL_LOCATION_ID=your_location_id
Use the GoHighLevel API.
Base URL: https://services.leadconnectorhq.com
My token is in .env (GHL_TOKEN, GHL_LOCATION_ID).
List my last 10 contacts. Show me the code before you run it.
You need one thing: a token. Then you call the API.
Step 1 — Make a token (Guide 1, Way A for your own account).
Step 2 — Call the API. Put the token in the header.
const token = process.env.GHL_TOKEN;
const res = await fetch("https://services.leadconnectorhq.com/contacts/v1/contacts", {
headers: { Authorization: "Bearer " + token }
});
const data = await res.json();
console.log(data.contacts);
Building an app for others (OAuth): create the app, get the code (Guide 1, Way B), swap the code for a token, store the refresh token, and call the API like above.
Common errors:
401 = bad or dead token. Make a new one.403 = missing scope. Add it, then approve again.429 = too fast. Slow down. (See Limits.)Webhooks (GHL sends you events, like "a contact was made"): they need an OAuth app. Private tokens do not get webhooks.
How much you can send. And what you can't do.
| What | Limit |
|---|---|
| Speed | 100 requests per 10 seconds |
| Per day | 200,000 requests per day |
| How it counts | Per app, per sub-account |
Example: one app on two sub-accounts = 400,000 requests a day. Each sub-account gets its own full allowance.
429? You went too fast. Wait, then go again.