GoHighLevel “Company ID” vs “Location ID”: the difference explained
Short answer: Company ID identifies the agency (the top-level account that owns sub-accounts). Location ID identifies a single sub-account underneath that agency. They are not interchangeable, and using the wrong one is the most common reason a GoHighLevel API call returns 401, 403, or empty data.
This guide is for developers wiring up integrations against the GoHighLevel API or building marketplace apps. It explains what each ID is, where to find it, and which one your endpoint actually needs.
Building a lead automation flow on top of GoHighLevel? Try NZ Leads free and let it handle the inbound replies while GoHighLevel handles the pipeline.
The structure GoHighLevel uses
GoHighLevel is built around a two-tier hierarchy:
- Company (also called Agency): The top-level account. One per agency. Owns billing, branding, and every sub-account beneath it.
- Location (also called Sub-Account): A single client workspace. One per business the agency manages. Holds contacts, conversations, calendars, pipelines, and workflows for that one business.
Every API resource lives at one of these two levels. A workflow lives in a Location. A snapshot template lives at the Company level. Knowing which level the resource lives at tells you which ID the endpoint expects.
What does the Company ID look like?
A company ID is a 24-character MongoDB-style ObjectId, for example:
companyId: 5DP4iH6HLkQsiKESj6rh
You will see it referenced as companyId in API responses and OAuth payloads. In the GoHighLevel UI it is sometimes labeled “Agency ID” under Settings -> Company.
What does the Location ID look like?
Same shape, different scope:
locationId: ve9EPM428h8vShlRW1KT
In the UI it lives under each sub-account at Settings -> Business Profile, or in the URL when you are inside a sub-account: app.gohighlevel.com/v2/location/<LOCATION_ID>/dashboard.
When does the API need Company ID vs Location ID?
The rule of thumb:
| If you are working with… | Use this ID |
|---|---|
| Contacts, conversations, opportunities | Location ID |
| Calendars, appointments, workflows | Location ID |
| Custom fields, custom values, tags on a sub-account | Location ID |
| Pipeline stages, forms, surveys for one client | Location ID |
| Snapshots, agency users, agency-wide settings | Company ID |
| Creating new sub-accounts | Company ID |
| Marketplace app installs at the agency level | Company ID |
OAuth tokens with agency scope | Company ID |
OAuth tokens with location scope | Location ID |
A useful mental model: if the data belongs to one client business, you need Location ID. If the data belongs to the agency that manages many businesses, you need Company ID.
Common mistakes (and the error you will see)
These are the failures we see most often when integrating with GoHighLevel:
- Using Company ID on a Location-scoped endpoint. The API returns 403 Forbidden or an empty array. Switch to the correct Location ID.
- Using Location ID with an Agency OAuth token. The token does not have permission for that location. Either use a Location-scoped token or call the
/oauth/locationTokenendpoint to mint one for the specific Location. - Caching the wrong ID after sub-account switching. When your app supports multiple agencies, store the Company ID and Location ID together for each authenticated session. Do not assume the last one used is still valid.
- Confusing
userIdwithlocationId. A user belongs to one or more locations but has its own ID. They are not the same.
OAuth: which ID does my token cover?
When you complete the OAuth flow GoHighLevel returns a token plus a userType field of either Company or Location. The token is scoped to that level.
If you start with a Company-level token and need to act on a specific Location, exchange it via:
POST /oauth/locationToken
Body: { companyId, locationId }
This returns a Location-scoped token you can use against any Location endpoint for that sub-account.
Webhooks: which ID is in the payload?
Webhook payloads include both when relevant. A new contact webhook from a sub-account looks like:
{
"type": "ContactCreate",
"locationId": "ve9EPM428h8vShlRW1KT",
"companyId": "5DP4iH6HLkQsiKESj6rh",
"contactId": "..."
}
When routing webhook events on your side, key on locationId if the event belongs to a single client, and on companyId for agency-level events like sub-account creation.
How to find each ID without writing code
- Company ID: Log in as agency admin -> Settings -> Company -> the ID is in the URL or shown on the page.
- Location ID: Switch into the sub-account -> the URL contains
/location/<LOCATION_ID>/. Or callGET /locations/with an Agency token to list all locations and their IDs.
Frequently asked questions
Can I use the Company ID for a Location API call?
No. Location-scoped endpoints (contacts, conversations, calendars, opportunities) require a Location ID. Sending a Company ID returns 403 or empty results.
Are Company ID and Agency ID the same thing?
Yes. GoHighLevel uses both terms in different parts of the documentation but they refer to the same identifier for the top-level agency account.
How do I get a Location token from a Company token?
Call POST /oauth/locationToken with the companyId and locationId in the body. You get back an access_token scoped to that Location.
What if I have multiple agencies in one app?
Store both IDs per authenticated session. Index your records on companyId + locationId so a single user can switch between agencies without ID collisions.
Does the Location ID change if I rebrand the sub-account?
No. Renaming a sub-account or changing its branding does not change the underlying Location ID. The ID is permanent for the lifetime of the sub-account.
Where does this matter for lead automation?
Anywhere you push leads into GoHighLevel from an external source. NZ Leads, for example, sends qualified inbound leads into the right sub-account using the Location ID. Sending to the wrong ID puts the lead in the wrong workspace or rejects it outright.
Building lead handling on top of GoHighLevel? Try NZ Leads free and let it run the AI replies while GoHighLevel runs the pipeline.