3.3 KiB
3.3 KiB
GHL Companies API
Endpoints: 1
Base URL: https://rest.gohighlevel.com/v1
Version Header(s): 2021-07-28
Endpoints
- GET /companies/{companyId} — Get Company
GET /companies/{companyId}
Summary: Get Company
Get Comapny
Version Header: 2021-07-28
Operation ID: get-company
Tags: Companies
cURL
curl -X GET 'https://rest.gohighlevel.com/v1/companies/ve9EPM428h8vShlRW1KT' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'User-Agent: YourApp/1.0'
Python (http.client)
import http.client
import json
conn = http.client.HTTPSConnection('rest.gohighlevel.com')
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Version': '2021-07-28',
'Content-Type': 'application/json',
'Accept': 'application/json',
'User-Agent': 'YourApp/1.0',
}
conn.request('GET', '/v1/companies/ve9EPM428h8vShlRW1KT', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
n8n HTTP Node
{
"name": "GHL - GET ve9EPM428h8vShlRW1KT",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/companies/ve9EPM428h8vShlRW1KT",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer YOUR_API_TOKEN"
},
{
"name": "Version",
"value": "2021-07-28"
},
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Accept",
"value": "application/json"
},
{
"name": "User-Agent",
"value": "YourApp/1.0"
}
]
},
"sendBody": false,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
To use in n8n:
- Add an HTTP Request node
- Switch to JSON mode (Parameters → use RAW JSON)
- Paste the JSON above
- Update
YOUR_API_TOKENwith your actual GHL API key
Request Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
companyId |
Path | string |
✅ | [example: ve9EPM428h8vShlRW1KT] |
Response Codes
| Code | Description | Schema |
|---|---|---|
200 |
Successful response | - company (GetCompanyByIdSchema) |
400 |
Bad Request | Standard error response for bad requests (400). Contains message, statusCode fields. |
401 |
Unauthorized | Standard error response for unauthorized requests (401). Contains message, statusCode fields. |
422 |
Unprocessable Entity | Standard error response for unprocessable entity (422). Contains message, statusCode, errors array fields. |
⚠️ Special Notes & Quirks
⚠️ User-Agent Required: All GHL API requests require a
User-AgentHTTP header. Requests without it may be rejected with a 403 error.
Documentation generated from GHL OpenAPI specifications. Verify against official docs for latest changes.