Primer commit

This commit is contained in:
2026-05-30 14:31:19 -06:00
commit a35d26fac0
277 changed files with 265240 additions and 0 deletions
File diff suppressed because it is too large Load Diff
+659
View File
@@ -0,0 +1,659 @@
# GHL Businesses API
**Endpoints:** 5
**Base URL:** `https://rest.gohighlevel.com/v1`
**Version Header(s):** `2021-07-28`
---
## Endpoints
- [GET /businesses/](#get--businesses-) — Get Businesses by Location
- [POST /businesses/](#post--businesses-) — Create Business
- [DELETE /businesses/{businessId}](#delete--businesses-businessId) — Delete Business
- [GET /businesses/{businessId}](#get--businesses-businessId) — Get Business
- [PUT /businesses/{businessId}](#put--businesses-businessId) — Update Business
---
## GET /businesses/
**Summary:** Get Businesses by Location
Get Businesses by Location
**Version Header:** `2021-07-28`
**Operation ID:** `get-businesses-by-location`
**Tags:** Businesses
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/businesses/?locationId=5DP4iH6HLkQsiKESj6rh&limit=100&skip=10' \
-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)
```python
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/businesses/?locationId=5DP4iH6HLkQsiKESj6rh&limit=100&skip=10', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET businesses",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/businesses/",
"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": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "locationId",
"value": "5DP4iH6HLkQsiKESj6rh"
},
{
"name": "limit",
"value": "100"
},
{
"name": "skip",
"value": "10"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `locationId` | Query | `string` | ✅ | [example: `5DP4iH6HLkQsiKESj6rh`] |
| `limit` | Query | `string` | — | [example: `100`] |
| `skip` | Query | `string` | — | [example: `10`] |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **businesses** (array of BusinessDto) (required): Business Response |
| `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. |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## POST /businesses/
**Summary:** Create Business
Create Business
**Version Header:** `2021-07-28`
**Operation ID:** `create-business`
**Tags:** Businesses
### cURL
```bash
curl -X POST 'https://rest.gohighlevel.com/v1/businesses/' \
-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' \
-d '{}' # See request body schema below
```
### Python (http.client)
```python
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',
}
payload = json.dumps({})
conn.request('POST', '/v1/businesses/', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - POST businesses",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://rest.gohighlevel.com/v1/businesses/",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Body Schema
- **name** (string) (required) (e.g. `Microsoft`)
- **locationId** (string) (required) (e.g. `5DP4iH6HLkQsiKESj6rh`)
- **phone** (string) (e.g. `+18832327657`)
- **email** (string) (e.g. `john@deo.com`)
- **website** (string) (e.g. `www.xyz.com`)
- **address** (string) (e.g. `street adress`)
- **city** (string) (e.g. `new york`)
- **postalCode** (string) (e.g. `12312312`)
- **state** (string) (e.g. `new york`)
- **country** (string) (e.g. `us`)
- **description** (string) (e.g. `business description`)
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `201` | Successful response | - **success** (boolean) (required) (e.g. `True`): Success Value<br> - **buiseness** (string) (required): Business Response |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## DELETE /businesses/{businessId}
**Summary:** Delete Business
Delete Business
**Version Header:** `2021-07-28`
**Operation ID:** `delete-Business`
**Tags:** Businesses
### cURL
```bash
curl -X DELETE 'https://rest.gohighlevel.com/v1/businesses/VALUE' \
-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)
```python
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('DELETE', '/v1/businesses/VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - DELETE VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "DELETE",
"url": "https://rest.gohighlevel.com/v1/businesses/VALUE",
"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:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `businessId` | Path | `string` | ✅ | |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **success** (boolean) (required) (e.g. `True`): Success value |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## GET /businesses/{businessId}
**Summary:** Get Business
Get Business
**Version Header:** `2021-07-28`
**Operation ID:** `get-business`
**Tags:** Businesses
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/businesses/VALUE' \
-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)
```python
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/businesses/VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/businesses/VALUE",
"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:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `businessId` | Path | `string` | ✅ | |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **business** (string) (required): Business Response |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## PUT /businesses/{businessId}
**Summary:** Update Business
Update Business
**Version Header:** `2021-07-28`
**Operation ID:** `update-business`
**Tags:** Businesses
### cURL
```bash
curl -X PUT 'https://rest.gohighlevel.com/v1/businesses/VALUE' \
-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' \
-d '{}' # See request body schema below
```
### Python (http.client)
```python
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',
}
payload = json.dumps({})
conn.request('PUT', '/v1/businesses/VALUE', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - PUT VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "PUT",
"url": "https://rest.gohighlevel.com/v1/businesses/VALUE",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `businessId` | Path | `string` | ✅ | |
### Request Body Schema
- **name** (string) (e.g. `Microsoft`)
- **phone** (string) (e.g. `+18832327657`)
- **email** (string) (e.g. `john@deo.com`)
- **postalCode** (string) (e.g. `12312312`)
- **website** (string) (e.g. `www.xyz.com`)
- **address** (string) (e.g. `street adress`)
- **state** (string) (e.g. `new york`)
- **city** (string) (e.g. `new york`)
- **country** (string) (e.g. `us`)
- **description** (string) (e.g. `business description`)
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **success** (boolean) (required) (e.g. `True`): Success Value<br> - **buiseness** (string) (required): Business Response |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
*Documentation generated from GHL OpenAPI specifications. Verify against official docs for latest changes.*
File diff suppressed because it is too large Load Diff
+150
View File
@@ -0,0 +1,150 @@
# GHL Campaigns API
**Endpoints:** 1
**Base URL:** `https://rest.gohighlevel.com/v1`
**Version Header(s):** `2021-07-28`
---
## Endpoints
- [GET /campaigns/](#get--campaigns-) — Get Campaigns
---
## GET /campaigns/
**Summary:** Get Campaigns
Get Campaigns
**Version Header:** `2021-07-28`
**Operation ID:** `get-campaigns`
**Tags:** Campaigns
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/campaigns/?locationId=VALUE&status=VALUE' \
-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)
```python
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/campaigns/?locationId=VALUE&status=VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET campaigns",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/campaigns/",
"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": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "locationId",
"value": "VALUE"
},
{
"name": "status",
"value": "VALUE"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `locationId` | Query | `string` | ✅ | |
| `status` | Query | `string` | — | |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **campaigns** (array of campaignsSchema) |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
*Documentation generated from GHL OpenAPI specifications. Verify against official docs for latest changes.*
+136
View File
@@ -0,0 +1,136 @@
# GHL Companies API
**Endpoints:** 1
**Base URL:** `https://rest.gohighlevel.com/v1`
**Version Header(s):** `2021-07-28`
---
## Endpoints
- [GET /companies/{companyId}](#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
```bash
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)
```python
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
```json
{
"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:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with 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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
*Documentation generated from GHL OpenAPI specifications. Verify against official docs for latest changes.*
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+133
View File
@@ -0,0 +1,133 @@
# GHL Courses API
**Endpoints:** 1
**Base URL:** `https://rest.gohighlevel.com/v1`
**Version Header(s):** `2021-07-28`
---
## Endpoints
- [POST /courses/courses-exporter/public/import](#post--courses-courses-exporter-public-import) — Import Courses
---
## POST /courses/courses-exporter/public/import
**Summary:** Import Courses
Import Courses through public channels
**Version Header:** `2021-07-28`
**Operation ID:** `import-courses`
### cURL
```bash
curl -X POST 'https://rest.gohighlevel.com/v1/courses/courses-exporter/public/import' \
-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' \
-d '{}' # See request body schema below
```
### Python (http.client)
```python
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',
}
payload = json.dumps({})
conn.request('POST', '/v1/courses/courses-exporter/public/import', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - POST import",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://rest.gohighlevel.com/v1/courses/courses-exporter/public/import",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Body Schema
- **locationId** (string) (required)
- **userId** (string)
- **products** (array of ProductInterface) (required)
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `201` | | — |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
*Documentation generated from GHL OpenAPI specifications. Verify against official docs for latest changes.*
File diff suppressed because it is too large Load Diff
+759
View File
@@ -0,0 +1,759 @@
# GHL Emails API
**Endpoints:** 5
**Base URL:** `https://rest.gohighlevel.com/v1`
**Version Header(s):** `2021-07-28`
---
## Endpoints
- [GET /emails/builder](#get--emails-builder) — Fetch email templates
- [POST /emails/builder](#post--emails-builder) — Create a new template
- [POST /emails/builder/data](#post--emails-builder-data) — Update a template
- [DELETE /emails/builder/{locationId}/{templateId}](#delete--emails-builder-locationId-templateId) — Delete a template
- [GET /emails/schedule](#get--emails-schedule) — Get Campaigns
---
## GET /emails/builder
**Summary:** Fetch email templates
Fetch email templates by location id
**Version Header:** `2021-07-28`
**Operation ID:** `fetch-template`
**Tags:** Templates
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/emails/builder?locationId=VALUE&limit=VALUE&offset=VALUE&search=VALUE&sortByDate=VALUE&archived=VALUE&builderVersion=1&name=VALUE&parentId=VALUE&originId=VALUE&templatesOnly=VALUE' \
-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)
```python
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/emails/builder?locationId=VALUE&limit=VALUE&offset=VALUE&search=VALUE&sortByDate=VALUE&archived=VALUE&builderVersion=VALUE&name=VALUE&parentId=VALUE&originId=VALUE&templatesOnly=VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET builder",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/emails/builder",
"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": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "locationId",
"value": "VALUE"
},
{
"name": "limit",
"value": "VALUE"
},
{
"name": "offset",
"value": "VALUE"
},
{
"name": "search",
"value": "VALUE"
},
{
"name": "sortByDate",
"value": "VALUE"
},
{
"name": "archived",
"value": "VALUE"
},
{
"name": "builderVersion",
"value": "VALUE"
},
{
"name": "name",
"value": "VALUE"
},
{
"name": "parentId",
"value": "VALUE"
},
{
"name": "originId",
"value": "VALUE"
},
{
"name": "templatesOnly",
"value": "VALUE"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `locationId` | Query | `string` | ✅ | |
| `limit` | Query | `string` | — | |
| `offset` | Query | `string` | — | |
| `search` | Query | `string` | — | |
| `sortByDate` | Query | `string` | — | |
| `archived` | Query | `string` | — | |
| `builderVersion` | Query | `string` | — | (values: 1, 2) |
| `name` | Query | `string` | — | |
| `parentId` | Query | `string` | — | |
| `originId` | Query | `string` | — | |
| `templatesOnly` | Query | `string` | — | |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Success | - **name** (string) (e.g. `New Template`): template name<br> - **updatedBy** (string) (e.g. `John Doe`): updated by<br> - **isPlainText** (boolean) (... |
| `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. |
| `404` | Not Found | — |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## POST /emails/builder
**Summary:** Create a new template
Create a new template
**Version Header:** `2021-07-28`
**Operation ID:** `create-template`
**Tags:** Templates
### cURL
```bash
curl -X POST 'https://rest.gohighlevel.com/v1/emails/builder' \
-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' \
-d '{}' # See request body schema below
```
### Python (http.client)
```python
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',
}
payload = json.dumps({})
conn.request('POST', '/v1/emails/builder', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - POST builder",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://rest.gohighlevel.com/v1/emails/builder",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Body Schema
- **locationId** (string) (required) (e.g. `ve9EPM428h8vShlRW1KT`)
- **title** (string) (e.g. `template title`)
- **type** (string) (required)
- **updatedBy** (string) (e.g. `zYy3YOUuHxgomU1uYJty`)
- **builderVersion** (string)
- **name** (string) (e.g. `Template1`)
- **parentId** (string) (e.g. `zYy3YOUuHxgomU1uYJty`)
- **templateDataUrl** (string) (e.g. ``)
- **importProvider** (string) (required)
- **importURL** (string) (e.g. `https://tplshare.com/fhYJ3Mi`)
- **templateSource** (string) (e.g. `template_library`)
- **isPlainText** (boolean) (e.g. `False`)
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `201` | Success | - **redirect** (string) (required) (e.g. `66e811229245fc098765590`): template id<br> - **traceId** (string) (required) (e.g. `0c52e980-41f6-4be7-8c... |
| `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. |
| `404` | Not Found | — |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## POST /emails/builder/data
**Summary:** Update a template
Update a template
**Version Header:** `2021-07-28`
**Operation ID:** `update-template`
**Tags:** Templates
### cURL
```bash
curl -X POST 'https://rest.gohighlevel.com/v1/emails/builder/data' \
-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' \
-d '{}' # See request body schema below
```
### Python (http.client)
```python
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',
}
payload = json.dumps({})
conn.request('POST', '/v1/emails/builder/data', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - POST data",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://rest.gohighlevel.com/v1/emails/builder/data",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Body Schema
- **locationId** (string) (required) (e.g. `ve9EPM428h8vShlRW1KT`)
- **templateId** (string) (required) (e.g. `zYy3YOUuHxgomU1uYJty`)
- **updatedBy** (string) (required) (e.g. `zYy3YOUuHxgomU1uYJty`)
- **dnd** (string) (required) (e.g. `{elements:[], attrs:{}, templateSettings:{}}`)
- **html** (string) (required) (e.g. ``)
- **editorType** (string) (required)
- **previewText** (string) (e.g. `zYy3YOUuHxgomU1uYJty`)
- **isPlainText** (boolean) (e.g. `false`)
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `201` | Success | - **ok** (string) (e.g. `true`): ok<br> - **traceId** (string) (e.g. `0c52e980-41f6-4be7-8c4b-32332ss`): trace id<br> - **previewUrl** (string) (e.g.... |
| `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. |
| `404` | Not Found | — |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## DELETE /emails/builder/{locationId}/{templateId}
**Summary:** Delete a template
Delete a template
**Version Header:** `2021-07-28`
**Operation ID:** `delete-template`
**Tags:** Templates
### cURL
```bash
curl -X DELETE 'https://rest.gohighlevel.com/v1/emails/builder/VALUE/VALUE' \
-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)
```python
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('DELETE', '/v1/emails/builder/VALUE/VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - DELETE VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "DELETE",
"url": "https://rest.gohighlevel.com/v1/emails/builder/VALUE/VALUE",
"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:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `locationId` | Path | `string` | ✅ | |
| `templateId` | Path | `string` | ✅ | |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Success | - **ok** (string) (e.g. `true`): ok<br> - **traceId** (string) (e.g. `0c52e980-41f6-4be7-8c4b-32332ss`): trace id |
| `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. |
| `404` | Not Found | — |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## GET /emails/schedule
**Summary:** Get Campaigns
Get Campaigns
**Version Header:** `2021-07-28`
**Operation ID:** `fetch-campaigns`
**Tags:** Campaigns
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/emails/schedule?locationId=VALUE&limit=VALUE&offset=VALUE&status=active&emailStatus=all&name=VALUE&parentId=VALUE&limitedFields=VALUE&archived=VALUE&campaignsOnly=VALUE&showStats=VALUE' \
-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)
```python
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/emails/schedule?locationId=VALUE&limit=VALUE&offset=VALUE&status=VALUE&emailStatus=VALUE&name=VALUE&parentId=VALUE&limitedFields=VALUE&archived=VALUE&campaignsOnly=VALUE&showStats=VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET schedule",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/emails/schedule",
"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": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "locationId",
"value": "VALUE"
},
{
"name": "limit",
"value": "VALUE"
},
{
"name": "offset",
"value": "VALUE"
},
{
"name": "status",
"value": "VALUE"
},
{
"name": "emailStatus",
"value": "VALUE"
},
{
"name": "name",
"value": "VALUE"
},
{
"name": "parentId",
"value": "VALUE"
},
{
"name": "limitedFields",
"value": "VALUE"
},
{
"name": "archived",
"value": "VALUE"
},
{
"name": "campaignsOnly",
"value": "VALUE"
},
{
"name": "showStats",
"value": "VALUE"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `locationId` | Query | `string` | ✅ | Location ID to fetch campaigns from |
| `limit` | Query | `number` | — | Maximum number of campaigns to return. Defaults to 10, maximum is 100 |
| `offset` | Query | `number` | — | Number of campaigns to skip for pagination |
| `status` | Query | `string` | — | Filter by schedule status (values: active, pause, complete, cancelled, retry, draft, resend-sched... |
| `emailStatus` | Query | `string` | — | Filter by email delivery status (values: all, not-started, paused, cancelled, processing, resumed... |
| `name` | Query | `string` | — | Filter campaigns by name |
| `parentId` | Query | `string` | — | Filter campaigns by parent folder ID |
| `limitedFields` | Query | `boolean` | — | When true, returns only essential campaign fields like id, templateDataDownloadUrl, updatedAt, ty... |
| `archived` | Query | `boolean` | — | Filter archived campaigns |
| `campaignsOnly` | Query | `boolean` | — | Return only campaigns, excluding folders |
| `showStats` | Query | `boolean` | — | When true, returns campaign statistics including delivered count, opened count, clicked count and... |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Success | - **schedules** (array of ScheduleDto) (required): The list of campaigns<br> - **total** (array) (required): The total number of campaigns<br> - **tr... |
| `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. |
| `403` | The token does not have access to this location | - **statusCode** (number) (e.g. `403`)<br> - **message** (string) (e.g. `The token does not have access to this location`) |
| `404` | Not Found | - **statusCode** (number) (e.g. `404`)<br> - **message** (string) (e.g. `Not Found`)<br> - **error** (string) (e.g. `The requested resource was not f... |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
*Documentation generated from GHL OpenAPI specifications. Verify against official docs for latest changes.*
+451
View File
@@ -0,0 +1,451 @@
# GHL Forms API
**Endpoints:** 3
**Base URL:** `https://rest.gohighlevel.com/v1`
**Version Header(s):** `2021-07-28`
---
## Endpoints
- [GET /forms/](#get--forms-) — Get Forms
- [GET /forms/submissions](#get--forms-submissions) — Get Forms Submissions
- [POST /forms/upload-custom-files](#post--forms-upload-custom-files) — Upload files to custom fields
---
## GET /forms/
**Summary:** Get Forms
Get Forms
**Version Header:** `2021-07-28`
**Operation ID:** `get-forms`
**Tags:** Forms
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/forms/?locationId=VALUE&skip=VALUE&limit=VALUE&type=VALUE' \
-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)
```python
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/forms/?locationId=VALUE&skip=VALUE&limit=VALUE&type=VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET forms",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/forms/",
"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": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "locationId",
"value": "VALUE"
},
{
"name": "skip",
"value": "VALUE"
},
{
"name": "limit",
"value": "VALUE"
},
{
"name": "type",
"value": "VALUE"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `locationId` | Query | `string` | ✅ | |
| `skip` | Query | `number` | — | |
| `limit` | Query | `number` | — | Limit Per Page records count. will allow maximum up to 50 and default will be 10 |
| `type` | Query | `string` | — | |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **forms** (array of FormsParams)<br> - **total** (number) (e.g. `20`): Total number of forms |
| `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. |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## GET /forms/submissions
**Summary:** Get Forms Submissions
Get Forms Submissions
**Version Header:** `2021-07-28`
**Operation ID:** `get-forms-submissions`
**Tags:** Forms
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/forms/submissions?locationId=VALUE&page=VALUE&limit=VALUE&formId=VALUE&q=VALUE&startAt=VALUE&endAt=VALUE' \
-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)
```python
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/forms/submissions?locationId=VALUE&page=VALUE&limit=VALUE&formId=VALUE&q=VALUE&startAt=VALUE&endAt=VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET submissions",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/forms/submissions",
"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": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "locationId",
"value": "VALUE"
},
{
"name": "page",
"value": "VALUE"
},
{
"name": "limit",
"value": "VALUE"
},
{
"name": "formId",
"value": "VALUE"
},
{
"name": "q",
"value": "VALUE"
},
{
"name": "startAt",
"value": "VALUE"
},
{
"name": "endAt",
"value": "VALUE"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `locationId` | Query | `string` | ✅ | |
| `page` | Query | `number` | — | Page No. By default it will be 1 |
| `limit` | Query | `number` | — | Limit Per Page records count. will allow maximum up to 100 and default will be 20 |
| `formId` | Query | `string` | — | Filter submission by form id |
| `q` | Query | `string` | — | Filter by contactId, name, email or phone no. |
| `startAt` | Query | `string` | — | Get submission by starting of this date. By default it will be same date of last month(YYYY-MM-DD). |
| `endAt` | Query | `string` | — | Get submission by ending of this date. By default it will be current date(YYYY-MM-DD). |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **submissions** (array of FormsSubmissionsSubmissionsSchema)<br> - **meta** (metaSchema) |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## POST /forms/upload-custom-files
**Summary:** Upload files to custom fields
Post the necessary fields for the API to upload files. The files need to be a buffer with the key "< custom_field_id >_< file_id >". <br /> Here custom field id is the ID of your custom field and file id is a randomly generated id (or uuid) <br /> There is support for multiple file uploads as well. Have multiple fields in the format mentioned.<br />File size is limited to 50 MB.<br /><br /> The allowed file types are: <br/> <ul><li>PDF</li><li>DOCX</li><li>DOC</li><li>JPG</li><li>JPEG</li><li>PNG</li><li>GIF</li><li>CSV</li><li>XLSX</li><li>XLS</li><li>MP4</li><li>MPEG</li><li>ZIP</li><li>RAR</li><li>TXT</li><li>SVG</li></ul> <br /><br /> The API will return the updated contact object.
**Version Header:** `2021-07-28`
**Operation ID:** `upload-to-custom-fields`
**Tags:** Forms
### cURL
```bash
curl -X POST 'https://rest.gohighlevel.com/v1/forms/upload-custom-files?contactId=VALUE&locationId=VALUE' \
-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)
```python
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('POST', '/v1/forms/upload-custom-files?contactId=VALUE&locationId=VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - POST upload-custom-files",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://rest.gohighlevel.com/v1/forms/upload-custom-files",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "contactId",
"value": "VALUE"
},
{
"name": "locationId",
"value": "VALUE"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `contactId` | Query | `string` | ✅ | Contact ID to upload the file to. |
| `locationId` | Query | `string` | ✅ | Location ID of the contact. |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | — |
| `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. |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
*Documentation generated from GHL OpenAPI specifications. Verify against official docs for latest changes.*
+954
View File
@@ -0,0 +1,954 @@
# GHL Funnels API
**Endpoints:** 7
**Base URL:** `https://rest.gohighlevel.com/v1`
**Version Header(s):** `2021-07-28`
---
## Endpoints
- [GET /funnels/funnel/list](#get--funnels-funnel-list) — Fetch List of Funnels
- [POST /funnels/lookup/redirect](#post--funnels-lookup-redirect) — Create Redirect
- [GET /funnels/lookup/redirect/list](#get--funnels-lookup-redirect-list) — Fetch List of Redirects
- [DELETE /funnels/lookup/redirect/{id}](#delete--funnels-lookup-redirect-id) — Delete Redirect By Id
- [PATCH /funnels/lookup/redirect/{id}](#patch--funnels-lookup-redirect-id) — Update Redirect By Id
- [GET /funnels/page](#get--funnels-page) — Fetch list of funnel pages
- [GET /funnels/page/count](#get--funnels-page-count) — Fetch count of funnel pages
---
## GET /funnels/funnel/list
**Summary:** Fetch List of Funnels
Retrieves a list of all funnels based on the given query parameters.
**Version Header:** Not required
**Operation ID:** `getFunnels`
**Tags:** Funnel
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/funnels/funnel/list?locationId=VALUE&type=VALUE&category=VALUE&offset=VALUE&limit=VALUE&parentId=VALUE&name=VALUE' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'User-Agent: YourApp/1.0'
```
### Python (http.client)
```python
import http.client
import json
conn = http.client.HTTPSConnection('rest.gohighlevel.com')
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json',
'User-Agent': 'YourApp/1.0',
}
conn.request('GET', '/v1/funnels/funnel/list?locationId=VALUE&type=VALUE&category=VALUE&offset=VALUE&limit=VALUE&parentId=VALUE&name=VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET list",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/funnels/funnel/list",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer YOUR_API_TOKEN"
},
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Accept",
"value": "application/json"
},
{
"name": "User-Agent",
"value": "YourApp/1.0"
}
]
},
"sendBody": false,
"bodyParameters": {
"parameters": []
},
"options": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "locationId",
"value": "VALUE"
},
{
"name": "type",
"value": "VALUE"
},
{
"name": "category",
"value": "VALUE"
},
{
"name": "offset",
"value": "VALUE"
},
{
"name": "limit",
"value": "VALUE"
},
{
"name": "parentId",
"value": "VALUE"
},
{
"name": "name",
"value": "VALUE"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `locationId` | Query | `string` | ✅ | |
| `type` | Query | `string` | — | |
| `category` | Query | `string` | — | |
| `offset` | Query | `string` | — | |
| `limit` | Query | `string` | — | |
| `parentId` | Query | `string` | — | |
| `name` | Query | `string` | — | |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response - List of funnels returned | - **funnels** (object) (required) (e.g. `{'_id': 'SkIDfu0S4m3NYQyvWHC6', 'dateAdded': '2024-04-29T15:00:05.681Z', 'dateUpdated': '2024-04-29T15:0... |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## POST /funnels/lookup/redirect
**Summary:** Create Redirect
The "Create Redirect" API Allows adding a new url redirect to the system. Use this endpoint to create a url redirect with the specified details. Ensure that the required information is provided in the request payload.
**Version Header:** `2021-07-28`
**Operation ID:** `create-redirect`
**Tags:** Redirect
### cURL
```bash
curl -X POST 'https://rest.gohighlevel.com/v1/funnels/lookup/redirect' \
-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' \
-d '{}' # See request body schema below
```
### Python (http.client)
```python
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',
}
payload = json.dumps({})
conn.request('POST', '/v1/funnels/lookup/redirect', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - POST redirect",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://rest.gohighlevel.com/v1/funnels/lookup/redirect",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Body Schema
- **locationId** (string) (required) (e.g. `6p2RxpgtMKQwO3E6IUaT`)
- **domain** (string) (required) (e.g. `example.com`)
- **path** (string) (required) (e.g. `/Hello`)
- **target** (string) (required) (e.g. `https://www.google.com`)
- **action** (string) (required) (e.g. `URL`)
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **data** (string) (required): Data containing details of the created redirect |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## GET /funnels/lookup/redirect/list
**Summary:** Fetch List of Redirects
Retrieves a list of all URL redirects based on the given query parameters.
**Version Header:** `2021-07-28`
**Operation ID:** `fetch-redirects-list`
**Tags:** Redirect
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/funnels/lookup/redirect/list?locationId=VALUE&limit=VALUE&offset=VALUE&search=VALUE' \
-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)
```python
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/funnels/lookup/redirect/list?locationId=VALUE&limit=VALUE&offset=VALUE&search=VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET list",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/funnels/lookup/redirect/list",
"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": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "locationId",
"value": "VALUE"
},
{
"name": "limit",
"value": "VALUE"
},
{
"name": "offset",
"value": "VALUE"
},
{
"name": "search",
"value": "VALUE"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `locationId` | Query | `string` | ✅ | |
| `limit` | Query | `number` | ✅ | |
| `offset` | Query | `number` | ✅ | |
| `search` | Query | `string` | — | |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response - List of URL redirects returned | - **data** (object) (required) (e.g. `{'count': 42, 'data': []}`): Object containing the count of redirects and an array of redirect data |
| `422` | Unprocessable Entity - The provided data is invalid or incomplete | — |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## DELETE /funnels/lookup/redirect/{id}
**Summary:** Delete Redirect By Id
The "Delete Redirect By Id" API Allows deletion of a URL redirect from the system using its unique identifier. Use this endpoint to delete a URL redirect with the specified ID using details provided in the request payload.
**Version Header:** `2021-07-28`
**Operation ID:** `delete-redirect-by-id`
**Tags:** Redirect
### cURL
```bash
curl -X DELETE 'https://rest.gohighlevel.com/v1/funnels/lookup/redirect/VALUE?locationId=VALUE' \
-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)
```python
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('DELETE', '/v1/funnels/lookup/redirect/VALUE?locationId=VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - DELETE VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "DELETE",
"url": "https://rest.gohighlevel.com/v1/funnels/lookup/redirect/VALUE",
"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": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "locationId",
"value": "VALUE"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `id` | Path | `string` | ✅ | |
| `locationId` | Query | `string` | ✅ | |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response - URL redirect deleted successfully | - **data** (object) (required) (e.g. `{'status': 'ok'}`): Status of the delete operation |
| `422` | Unprocessable Entity - The provided data is invalid or incomplete | — |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## PATCH /funnels/lookup/redirect/{id}
**Summary:** Update Redirect By Id
The "Update Redirect By Id" API Allows updating an existing URL redirect in the system. Use this endpoint to modify a URL redirect with the specified ID using details provided in the request payload.
**Version Header:** `2021-07-28`
**Operation ID:** `update-redirect-by-id`
**Tags:** Redirect
### cURL
```bash
curl -X PATCH 'https://rest.gohighlevel.com/v1/funnels/lookup/redirect/VALUE' \
-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' \
-d '{}' # See request body schema below
```
### Python (http.client)
```python
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',
}
payload = json.dumps({})
conn.request('PATCH', '/v1/funnels/lookup/redirect/VALUE', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - PATCH VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "PATCH",
"url": "https://rest.gohighlevel.com/v1/funnels/lookup/redirect/VALUE",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `id` | Path | `string` | ✅ | |
### Request Body Schema
- **target** (string) (required) (e.g. `https://www.google.com`)
- **action** (string) (required) (e.g. `URL`)
- **locationId** (string) (required) (e.g. `6p2RxpgtMKQwO3E6IUaT`)
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **data** (string) (required): Data containing details of the updated redirect |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## GET /funnels/page
**Summary:** Fetch list of funnel pages
Retrieves a list of all funnel pages based on the given query parameters.
**Version Header:** Not required
**Operation ID:** `getPagesByFunnelId`
**Tags:** Funnel
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/funnels/page?locationId=VALUE&funnelId=VALUE&name=VALUE&limit=VALUE&offset=VALUE' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'User-Agent: YourApp/1.0'
```
### Python (http.client)
```python
import http.client
import json
conn = http.client.HTTPSConnection('rest.gohighlevel.com')
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json',
'User-Agent': 'YourApp/1.0',
}
conn.request('GET', '/v1/funnels/page?locationId=VALUE&funnelId=VALUE&name=VALUE&limit=VALUE&offset=VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET page",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/funnels/page",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer YOUR_API_TOKEN"
},
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Accept",
"value": "application/json"
},
{
"name": "User-Agent",
"value": "YourApp/1.0"
}
]
},
"sendBody": false,
"bodyParameters": {
"parameters": []
},
"options": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "locationId",
"value": "VALUE"
},
{
"name": "funnelId",
"value": "VALUE"
},
{
"name": "name",
"value": "VALUE"
},
{
"name": "limit",
"value": "VALUE"
},
{
"name": "offset",
"value": "VALUE"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `locationId` | Query | `string` | ✅ | |
| `funnelId` | Query | `string` | ✅ | |
| `name` | Query | `string` | — | |
| `limit` | Query | `number` | ✅ | |
| `offset` | Query | `number` | ✅ | |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response - List of funnel pages returned | - **_id** (string) (required) (e.g. `0yJbP3q7t7pLmeTWRAE2`)<br> - **locationId** (string) (required) (e.g. `ojQjykmwNIU88vfsfzvH`)<br> - **funnelId**... |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## GET /funnels/page/count
**Summary:** Fetch count of funnel pages
Retrieves count of all funnel pages based on the given query parameters.
**Version Header:** Not required
**Operation ID:** `getPagesCountByFunnelId`
**Tags:** Funnel
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/funnels/page/count?locationId=VALUE&funnelId=VALUE&name=VALUE' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'User-Agent: YourApp/1.0'
```
### Python (http.client)
```python
import http.client
import json
conn = http.client.HTTPSConnection('rest.gohighlevel.com')
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json',
'User-Agent': 'YourApp/1.0',
}
conn.request('GET', '/v1/funnels/page/count?locationId=VALUE&funnelId=VALUE&name=VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET count",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/funnels/page/count",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer YOUR_API_TOKEN"
},
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Accept",
"value": "application/json"
},
{
"name": "User-Agent",
"value": "YourApp/1.0"
}
]
},
"sendBody": false,
"bodyParameters": {
"parameters": []
},
"options": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "locationId",
"value": "VALUE"
},
{
"name": "funnelId",
"value": "VALUE"
},
{
"name": "name",
"value": "VALUE"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `locationId` | Query | `string` | ✅ | |
| `funnelId` | Query | `string` | ✅ | |
| `name` | Query | `string` | — | |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response - Count of funnel pages returned | - **count** (number) (required) (e.g. `20`) |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
*Documentation generated from GHL OpenAPI specifications. Verify against official docs for latest changes.*
File diff suppressed because it is too large Load Diff
+789
View File
@@ -0,0 +1,789 @@
# GHL Links API
> ⚠️ **Mixed Versions:** Most Links endpoints use `2021-07-28`, but `GET /links/search` uses `Version: 2021-04-15`.
**Endpoints:** 6
**Base URL:** `https://rest.gohighlevel.com/v1`
**Version Header(s):** `2021-04-15, 2021-07-28`
---
## Endpoints
- [GET /links/](#get--links-) — Get Links
- [POST /links/](#post--links-) — Create Link
- [GET /links/id/{linkId}](#get--links-id-linkId) — Get Link by ID
- [GET /links/search](#get--links-search) — Search Trigger Links
- [DELETE /links/{linkId}](#delete--links-linkId) — Delete Link
- [PUT /links/{linkId}](#put--links-linkId) — Update Link
---
## GET /links/
**Summary:** Get Links
Get Links
**Version Header:** `2021-07-28`
**Operation ID:** `get-links`
**Tags:** Trigger Links
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/links/?locationId=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)
```python
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/links/?locationId=ve9EPM428h8vShlRW1KT', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET links",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/links/",
"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": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "locationId",
"value": "ve9EPM428h8vShlRW1KT"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `locationId` | Query | `string` | ✅ | [example: `ve9EPM428h8vShlRW1KT`] |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **links** (array of LinkSchema) |
| `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. |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## POST /links/
**Summary:** Create Link
Create Link
**Version Header:** `2021-07-28`
**Operation ID:** `create-link`
**Tags:** Trigger Links
### cURL
```bash
curl -X POST 'https://rest.gohighlevel.com/v1/links/' \
-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' \
-d '{}' # See request body schema below
```
### Python (http.client)
```python
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',
}
payload = json.dumps({})
conn.request('POST', '/v1/links/', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - POST links",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://rest.gohighlevel.com/v1/links/",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Body Schema
- **locationId** (string) (required) (e.g. `ve9EPM428h8vShlRW1KT`)
- **name** (string) (required) (e.g. `first tag`)
- **redirectTo** (string) (required) (e.g. `https://www.google.com/`)
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `201` | Successful response | - **link** (LinkSchema) |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## GET /links/id/{linkId}
**Summary:** Get Link by ID
Get a single link by its ID
**Version Header:** `2021-07-28`
**Operation ID:** `get-link-by-id`
**Tags:** Trigger Links
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/links/id/VALUE?locationId=ABCHkzuJQ8ZMd4Te84GK' \
-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)
```python
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/links/id/VALUE?locationId=ABCHkzuJQ8ZMd4Te84GK', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/links/id/VALUE",
"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": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "locationId",
"value": "ABCHkzuJQ8ZMd4Te84GK"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `Authorization` | Header | `string` | ✅ | Access Token [example: `Bearer 9c48df2694a849b6089f9d0d3513efe`] |
| `locationId` | Query | `string` | ✅ | Location Id [example: `ABCHkzuJQ8ZMd4Te84GK`] |
| `linkId` | Path | `string` | ✅ | Link Id |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **link** (LinkSchema) |
| `400` | Bad Request | (ref: #/components/schemas/BadRequestDTO) |
| `401` | Unauthorized | (ref: #/components/schemas/UnauthorizedDTO) |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## GET /links/search
**Summary:** Search Trigger Links
Get list of links by searching
**Version Header:** `2021-04-15`
**Operation ID:** `search-trigger-links`
**Tags:** Trigger Links Search
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/links/search?locationId=ABCHkzuJQ8ZMd4Te84GK&query=Search string&skip=1&limit=10' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Version: 2021-04-15' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'User-Agent: YourApp/1.0'
```
### Python (http.client)
```python
import http.client
import json
conn = http.client.HTTPSConnection('rest.gohighlevel.com')
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Version': '2021-04-15',
'Content-Type': 'application/json',
'Accept': 'application/json',
'User-Agent': 'YourApp/1.0',
}
conn.request('GET', '/v1/links/search?locationId=ABCHkzuJQ8ZMd4Te84GK&query=Search string&skip=1&limit=10', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET search",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/links/search",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer YOUR_API_TOKEN"
},
{
"name": "Version",
"value": "2021-04-15"
},
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Accept",
"value": "application/json"
},
{
"name": "User-Agent",
"value": "YourApp/1.0"
}
]
},
"sendBody": false,
"bodyParameters": {
"parameters": []
},
"options": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "locationId",
"value": "ABCHkzuJQ8ZMd4Te84GK"
},
{
"name": "query",
"value": "Search string"
},
{
"name": "skip",
"value": 1
},
{
"name": "limit",
"value": 10
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `Authorization` | Header | `string` | ✅ | Access Token [example: `Bearer 9c48df2694a849b6089f9d0d3513efe`] |
| `locationId` | Query | `string` | ✅ | Location Id [example: `ABCHkzuJQ8ZMd4Te84GK`] |
| `query` | Query | `string` | — | Search query as a string [example: `Search string`] |
| `skip` | Query | `number` | — | Numbers of query results to skip [example: `1`] |
| `limit` | Query | `number` | — | Limit on number of search results [example: `10`] |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **links** (array of LinkSchema) |
| `400` | Bad Request | (ref: #/components/schemas/BadRequestDTO) |
| `401` | Unauthorized | (ref: #/components/schemas/UnauthorizedDTO) |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## DELETE /links/{linkId}
**Summary:** Delete Link
Delete Link
**Version Header:** `2021-07-28`
**Operation ID:** `delete-link`
**Tags:** Trigger Links
### cURL
```bash
curl -X DELETE 'https://rest.gohighlevel.com/v1/links/VALUE' \
-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)
```python
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('DELETE', '/v1/links/VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - DELETE VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "DELETE",
"url": "https://rest.gohighlevel.com/v1/links/VALUE",
"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:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `linkId` | Path | `string` | ✅ | Link Id |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `201` | Successful response | - **succeded** (boolean) (e.g. `True`) |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## PUT /links/{linkId}
**Summary:** Update Link
Update Link
**Version Header:** `2021-07-28`
**Operation ID:** `update-link`
**Tags:** Trigger Links
### cURL
```bash
curl -X PUT 'https://rest.gohighlevel.com/v1/links/VALUE' \
-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' \
-d '{}' # See request body schema below
```
### Python (http.client)
```python
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',
}
payload = json.dumps({})
conn.request('PUT', '/v1/links/VALUE', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - PUT VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "PUT",
"url": "https://rest.gohighlevel.com/v1/links/VALUE",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `linkId` | Path | `string` | ✅ | Link Id |
### Request Body Schema
- **name** (string) (required) (e.g. `first tag`)
- **redirectTo** (string) (required) (e.g. `https://www.google.com/`)
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `201` | Successful response | - **link** (LinkSchema) |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
*Documentation generated from GHL OpenAPI specifications. Verify against official docs for latest changes.*
File diff suppressed because it is too large Load Diff
+914
View File
@@ -0,0 +1,914 @@
# GHL Media API
**Endpoints:** 7
**Base URL:** `https://rest.gohighlevel.com/v1`
**Version Header(s):** `2021-07-28`
---
## Endpoints
- [PUT /medias/delete-files](#put--medias-delete-files) — Bulk Delete / Trash Files or Folders
- [GET /medias/files](#get--medias-files) — Get List of Files/ Folders
- [POST /medias/folder](#post--medias-folder) — Create Folder
- [PUT /medias/update-files](#put--medias-update-files) — Bulk Update Files/ Folders
- [POST /medias/upload-file](#post--medias-upload-file) — Upload File into Media Storage
- [DELETE /medias/{id}](#delete--medias-id) — Delete File or Folder
- [POST /medias/{id}](#post--medias-id) — Update File/ Folder
---
## PUT /medias/delete-files
**Summary:** Bulk Delete / Trash Files or Folders
Soft-deletes or trashes multiple files and folders in a single request
**Version Header:** `2021-07-28`
**Operation ID:** `bulk-delete-media-objects`
**Tags:** Medias
### cURL
```bash
curl -X PUT 'https://rest.gohighlevel.com/v1/medias/delete-files' \
-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' \
-d '{}' # See request body schema below
```
### Python (http.client)
```python
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',
}
payload = json.dumps({})
conn.request('PUT', '/v1/medias/delete-files', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - PUT delete-files",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "PUT",
"url": "https://rest.gohighlevel.com/v1/medias/delete-files",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Body Schema
- **filesToBeDeleted** (array of DeleteMediaObjectItem) (required) (e.g. `[{'_id': '686f630df0d3166d68fbcec2'}]`): Array of file objects to be deleted or trashed
- **altType** (string) (required) (e.g. `location`): Type of entity that owns the files
- **altId** (string) (required) (e.g. `sx6wyHhbFdRXh302LLNR`): Location identifier
- **status** (string) (required) (e.g. `deleted`): Status to set for the files (deleted or trashed)
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | object — no documented properties |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## GET /medias/files
**Summary:** Get List of Files/ Folders
Fetches list of files and folders from the media storage
**Version Header:** `2021-07-28`
**Operation ID:** `fetch-media-content`
**Tags:** Medias
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/medias/files?offset=VALUE&limit=VALUE&sortBy=VALUE&sortOrder=VALUE&type=VALUE&query=VALUE&altType=location&altId=VALUE&parentId=VALUE&fetchAll=VALUE' \
-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)
```python
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/medias/files?offset=VALUE&limit=VALUE&sortBy=VALUE&sortOrder=VALUE&type=VALUE&query=VALUE&altType=VALUE&altId=VALUE&parentId=VALUE&fetchAll=VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET files",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/medias/files",
"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": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "offset",
"value": "VALUE"
},
{
"name": "limit",
"value": "VALUE"
},
{
"name": "sortBy",
"value": "VALUE"
},
{
"name": "sortOrder",
"value": "VALUE"
},
{
"name": "type",
"value": "VALUE"
},
{
"name": "query",
"value": "VALUE"
},
{
"name": "altType",
"value": "VALUE"
},
{
"name": "altId",
"value": "VALUE"
},
{
"name": "parentId",
"value": "VALUE"
},
{
"name": "fetchAll",
"value": "VALUE"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `offset` | Query | `string` | — | Number of files to skip in listing |
| `limit` | Query | `string` | — | Number of files to show in the listing |
| `sortBy` | Query | `string` | ✅ | Field to sorting the file listing by |
| `sortOrder` | Query | `string` | ✅ | Direction in which file needs to be sorted |
| `type` | Query | `string` | ✅ | Type |
| `query` | Query | `string` | — | Query text |
| `altType` | Query | `string` | ✅ | AltType (values: location) |
| `altId` | Query | `string` | ✅ | location Id |
| `parentId` | Query | `string` | — | parent id or folder id |
| `fetchAll` | Query | `string` | — | Fetch all files or folders |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **files** (array) (required) (e.g. `{'altId': 'locationId', 'altType': 'location', 'name': 'file name', 'parentId': 'parent folder id', 'url': ... |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## POST /medias/folder
**Summary:** Create Folder
Creates a new folder in the media storage
**Version Header:** `2021-07-28`
**Operation ID:** `create-media-folder`
**Tags:** Medias
### cURL
```bash
curl -X POST 'https://rest.gohighlevel.com/v1/medias/folder' \
-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' \
-d '{}' # See request body schema below
```
### Python (http.client)
```python
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',
}
payload = json.dumps({})
conn.request('POST', '/v1/medias/folder', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - POST folder",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://rest.gohighlevel.com/v1/medias/folder",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Body Schema
- **altId** (string) (required) (e.g. `sx6wyHhbFdRXh302LLNR`): Location Id
- **altType** (string) (required) (e.g. `location`): Type of entity (location only)
- **name** (string) (required) (e.g. `New Folder`): Name of the folder to be created
- **parentId** (string) (e.g. `64af50c42d567a3b4f5989e0`): ID of the parent folder (optional)
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Returns the newly created folder object | - **altId** (string) (required) (e.g. `sx6wyHhbFdRXh302LLNR`): Location identifier that owns this folder<br> - **altType** (string) (required) (e.g... |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## PUT /medias/update-files
**Summary:** Bulk Update Files/ Folders
Updates metadata or status of multiple files and folders
**Version Header:** `2021-07-28`
**Operation ID:** `bulk-update-media-objects`
**Tags:** Medias
### cURL
```bash
curl -X PUT 'https://rest.gohighlevel.com/v1/medias/update-files' \
-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' \
-d '{}' # See request body schema below
```
### Python (http.client)
```python
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',
}
payload = json.dumps({})
conn.request('PUT', '/v1/medias/update-files', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - PUT update-files",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "PUT",
"url": "https://rest.gohighlevel.com/v1/medias/update-files",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Body Schema
- **altId** (string) (required) (e.g. `sx6wyHhbFdRXh302LLNR`): Location identifier
- **altType** (string) (required) (e.g. `location`): Type of entity that owns the files
- **filesToBeUpdated** (array of UpdateMediaObject) (required) (e.g. `[{'id': '686f9817f0d3165be9fbcef6', 'name': 'Updated File Name.pdf'}]`): Array of file objects to be updated
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | object — no documented properties |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## POST /medias/upload-file
**Summary:** Upload File into Media Storage
If hosted is set to true then fileUrl is required. Else file is required. If adding a file, maximum allowed is 25 MB
**Version Header:** `2021-07-28`
**Operation ID:** `upload-media-content`
**Tags:** Medias
### cURL
```bash
curl -X POST 'https://rest.gohighlevel.com/v1/medias/upload-file' \
-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)
```python
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('POST', '/v1/medias/upload-file', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - POST upload-file",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://rest.gohighlevel.com/v1/medias/upload-file",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **fileId** (string) (required) (e.g. `file.pdf`): ID of the uploaded file<br> - **url** (string) (required) (e.g. `https://storage.googleapis.com... |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## DELETE /medias/{id}
**Summary:** Delete File or Folder
Deletes specific file or folder from the media storage
**Version Header:** `2021-07-28`
**Operation ID:** `delete-media-content`
**Tags:** Medias
### cURL
```bash
curl -X DELETE 'https://rest.gohighlevel.com/v1/medias/VALUE?altType=location&altId=VALUE' \
-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)
```python
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('DELETE', '/v1/medias/VALUE?altType=VALUE&altId=VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - DELETE VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "DELETE",
"url": "https://rest.gohighlevel.com/v1/medias/VALUE",
"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": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "altType",
"value": "VALUE"
},
{
"name": "altId",
"value": "VALUE"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `id` | Path | `string` | ✅ | |
| `altType` | Query | `string` | ✅ | AltType (values: location) |
| `altId` | Query | `string` | ✅ | location Id |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | — |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## POST /medias/{id}
**Summary:** Update File/ Folder
Updates a single file or folder by ID
**Version Header:** `2021-07-28`
**Operation ID:** `update-media-object`
**Tags:** Medias
### cURL
```bash
curl -X POST 'https://rest.gohighlevel.com/v1/medias/VALUE' \
-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' \
-d '{}' # See request body schema below
```
### Python (http.client)
```python
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',
}
payload = json.dumps({})
conn.request('POST', '/v1/medias/VALUE', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - POST VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://rest.gohighlevel.com/v1/medias/VALUE",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `id` | Path | `string` | ✅ | Unique identifier of the file or folder to update |
### Request Body Schema
- **name** (string) (required) (e.g. `Updated File Name.pdf`): New name for the file or folder
- **altType** (string) (required) (e.g. `location`): Type of entity that owns the file or folder
- **altId** (string) (required) (e.g. `sx6wyHhbFdRXh302LLNR`): Location identifier that owns the file or folder
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | object — no documented properties |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
*Documentation generated from GHL OpenAPI specifications. Verify against official docs for latest changes.*
+412
View File
@@ -0,0 +1,412 @@
# GHL OAuth API
**Endpoints:** 3
**Base URL:** `https://rest.gohighlevel.com/v1`
**Version Header(s):** `2021-07-28`
---
## Endpoints
- [GET /oauth/installedLocations](#get--oauth-installedLocations) — Get Location where app is installed
- [POST /oauth/locationToken](#post--oauth-locationToken) — Get Location Access Token from Agency Token
- [POST /oauth/token](#post--oauth-token) — Get Access Token
---
## GET /oauth/installedLocations
**Summary:** Get Location where app is installed
This API allows you fetch location where app is installed upon
**Version Header:** `2021-07-28`
**Operation ID:** `get-installed-location`
**Tags:** OAuth 2.0
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/oauth/installedLocations?skip=1&limit=10&query=location name&isInstalled=True&companyId=tDtDnQdgm2LXpyiqYvZ6&appId=tDtDnQdgm2LXpyiqYvZ6&versionId=tDtDnQdgm2LXpyiqYvZ6&onTrial=True&planId=True&locationId=1245' \
-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)
```python
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/oauth/installedLocations?skip=1&limit=10&query=location name&isInstalled=True&companyId=tDtDnQdgm2LXpyiqYvZ6&appId=tDtDnQdgm2LXpyiqYvZ6&versionId=tDtDnQdgm2LXpyiqYvZ6&onTrial=True&planId=True&locationId=1245', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET installedLocations",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/oauth/installedLocations",
"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": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "skip",
"value": "1"
},
{
"name": "limit",
"value": "10"
},
{
"name": "query",
"value": "location name"
},
{
"name": "isInstalled",
"value": true
},
{
"name": "companyId",
"value": "tDtDnQdgm2LXpyiqYvZ6"
},
{
"name": "appId",
"value": "tDtDnQdgm2LXpyiqYvZ6"
},
{
"name": "versionId",
"value": "tDtDnQdgm2LXpyiqYvZ6"
},
{
"name": "onTrial",
"value": true
},
{
"name": "planId",
"value": true
},
{
"name": "locationId",
"value": "1245"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `skip` | Query | `string` | — | Parameter to skip the number installed locations [example: `1`] |
| `limit` | Query | `string` | — | Parameter to limit the number installed locations [example: `10`] |
| `query` | Query | `string` | — | Parameter to search for the installed location by name [example: `location name`] |
| `isInstalled` | Query | `boolean` | — | Filters out location which are installed for specified app under the specified company [example: ... |
| `companyId` | Query | `string` | ✅ | Parameter to search by the companyId [example: `tDtDnQdgm2LXpyiqYvZ6`] |
| `appId` | Query | `string` | ✅ | Parameter to search by the appId [example: `tDtDnQdgm2LXpyiqYvZ6`] |
| `versionId` | Query | `string` | — | VersionId of the app [example: `tDtDnQdgm2LXpyiqYvZ6`] |
| `onTrial` | Query | `boolean` | — | Filters out locations which are installed for specified app in trial mode [example: `True`] |
| `planId` | Query | `string` | — | Filters out location which are installed for specified app under the specified planId [example: `... |
| `locationId` | Query | `string` | — | locationId [example: `1245`] |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **locations** (array of InstalledLocationSchema)<br> - **count** (number) (e.g. `1231`): Total location count under the company<br> - **installToFu... |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## POST /oauth/locationToken
**Summary:** Get Location Access Token from Agency Token
This API allows you to generate locationAccessToken from AgencyAccessToken
**Version Header:** `2021-07-28`
**Operation ID:** `get-location-access-token`
**Tags:** OAuth 2.0
### cURL
```bash
curl -X POST 'https://rest.gohighlevel.com/v1/oauth/locationToken' \
-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)
```python
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('POST', '/v1/oauth/locationToken', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - POST locationToken",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://rest.gohighlevel.com/v1/oauth/locationToken",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **access_token** (string) (e.g. `ab12dc0ae1234a7898f9ff06d4f69gh`): Location access token which can be used to authenticate & authorize API und... |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## POST /oauth/token
**Summary:** Get Access Token
Use Access Tokens to access GoHighLevel resources on behalf of an authenticated location/company.
**Version Header:** Not required
**Operation ID:** `get-access-token`
**Tags:** OAuth 2.0
### cURL
```bash
curl -X POST 'https://rest.gohighlevel.com/v1/oauth/token' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'User-Agent: YourApp/1.0'
```
### Python (http.client)
```python
import http.client
import json
conn = http.client.HTTPSConnection('rest.gohighlevel.com')
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json',
'User-Agent': 'YourApp/1.0',
}
conn.request('POST', '/v1/oauth/token', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - POST token",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://rest.gohighlevel.com/v1/oauth/token",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer YOUR_API_TOKEN"
},
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Accept",
"value": "application/json"
},
{
"name": "User-Agent",
"value": "YourApp/1.0"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **access_token** (string) (e.g. `ab12dc0ae1234a7898f9ff06d4f69gh`)<br> - **token_type** (string) (e.g. `Bearer`)<br> - **expires_in** (number) (e.g... |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
*Documentation generated from GHL OpenAPI specifications. Verify against official docs for latest changes.*
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+958
View File
@@ -0,0 +1,958 @@
# GHL Users API
> ⚠️ **Deprecations:** Email update is deprecated. User deletion is asynchronous (returns 202 Accepted). `GET /users/` is deprecated — use `GET /users/search` instead.
**Endpoints:** 7
**Base URL:** `https://rest.gohighlevel.com/v1`
**Version Header(s):** `2021-07-28`
---
## Endpoints
- [GET /users/](#get--users-) — Get User by Location
- [POST /users/](#post--users-) — Create User
- [GET /users/search](#get--users-search) — Search Users
- [POST /users/search/filter-by-email](#post--users-search-filter-by-email) — Filter Users by Email
- [DELETE /users/{userId}](#delete--users-userId) — Delete User
- [GET /users/{userId}](#get--users-userId) — Get User
- [PUT /users/{userId}](#put--users-userId) — Update User
---
## GET /users/
> ⚠️ **DEPRECATED** — This endpoint is deprecated and may be removed in a future version.
**Summary:** Get User by Location
Deprecated. Use `GET /users/search` instead. Pass `locationId` as a query parameter to filter results by location, along with the required `companyId` and other search filters as needed.
**Version Header:** `2021-07-28`
**Operation ID:** `get-user-by-location`
**Tags:** Users
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/users/?locationId=s4BtzHFWmT28mbb85uPa' \
-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)
```python
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/users/?locationId=s4BtzHFWmT28mbb85uPa', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET users",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/users/",
"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": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "locationId",
"value": "s4BtzHFWmT28mbb85uPa"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `locationId` | Query | `string` | ✅ | [example: `s4BtzHFWmT28mbb85uPa`] |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **users** (array of UserSchema) |
| `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. |
### ⚠️ Special Notes & Quirks
> ⚠️ **User-Agent Required:** All GHL API requests require a `User-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## POST /users/
**Summary:** Create User
Create User
**Version Header:** `2021-07-28`
**Operation ID:** `create-user`
**Tags:** Users
### cURL
```bash
curl -X POST 'https://rest.gohighlevel.com/v1/users/' \
-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' \
-d '{}' # See request body schema below
```
### Python (http.client)
```python
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',
}
payload = json.dumps({})
conn.request('POST', '/v1/users/', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - POST users",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://rest.gohighlevel.com/v1/users/",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Body Schema
- **companyId** (string) (required) (e.g. `ve9EPM428h8vShlRW1KT`)
- **firstName** (string) (required) (e.g. `John`)
- **lastName** (string) (required) (e.g. `Deo`)
- **email** (string) (required) (e.g. `john@deo.com`)
- **password** (string) (required) (e.g. `*******`)
- **phone** (string) (e.g. `+18832327657`)
- **type** (string) (required) (e.g. `account`)
- **role** (string) (required) (e.g. `admin`)
- **locationIds** (array) (required) (e.g. `['C2QujeCh8ZnC7al2InWR']`)
- **permissions** (PermissionsDto)
- **scopes** (array) (e.g. `['contacts.write', 'campaigns.readonly']`): Scopes allowed for users. Only scopes that have been passed will be enabled. Note:- If passed empty all the scopes will be get disabled
- **scopesAssignedToOnly** (array) (e.g. `['contacts.write', 'campaigns.readonly']`): Assigned Scopes allowed for users. Only scopes that have been passed will be enabled. If passed empty all the assigned scopes will be get disabled
- **profilePhoto** (string) (e.g. `https://img.png`)
- **twilioPhone** (object) (e.g. `{'C2QujeCh8ZnC7al2InWR': '+18832327657', 'M2QrtfVt8ZnC7cv2InDL': '+18832327657'}`): Per-location inbound Twilio number in E.164 format, keyed by location id (Call and Voicemail Inbound Number for direct Twilio, not LC Phone). Replacement semantics: if you send twilioPhone in the request body, the stored map is replaced entirely with this object (not merged). Any location id omitted from the object is removed from the saved map. Omit the twilioPhone property entirely to leave existing numbers unchanged. Send an empty object {} to clear all per-location numbers. To clear a single location only, set that location id to an empty string "".
- **platformLanguage** (string) (e.g. `en_US`): Platform language preference for the user
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `201` | Successful response | - **id** (string) (e.g. `0IHuJvc2ofPAAA8GzTRi`)<br> - **name** (string) (e.g. `John Deo`)<br> - **firstName** (string) (e.g. `John`)<br> - **lastName**... |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## GET /users/search
**Summary:** Search Users
Search Users
**Version Header:** `2021-07-28`
**Operation ID:** `search-users`
**Tags:** Search
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/users/search?companyId=5DP41231LkQsiKESj6rh&query=John&skip=1&limit=10&locationId=5DP41231LkQsiKESj6rh&type=agency&role=admin&ids=5DP4iH6HLkQsiKESj6rh,5DP4iH6HLkQsiKESj34h&sort=dateAdded&sortDirection=asc&enabled2waySync=VALUE' \
-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)
```python
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/users/search?companyId=5DP41231LkQsiKESj6rh&query=John&skip=1&limit=10&locationId=5DP41231LkQsiKESj6rh&type=agency&role=admin&ids=5DP4iH6HLkQsiKESj6rh,5DP4iH6HLkQsiKESj34h&sort=dateAdded&sortDirection=asc&enabled2waySync=VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET search",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/users/search",
"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": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "companyId",
"value": "5DP41231LkQsiKESj6rh"
},
{
"name": "query",
"value": "John"
},
{
"name": "skip",
"value": "1"
},
{
"name": "limit",
"value": "10"
},
{
"name": "locationId",
"value": "5DP41231LkQsiKESj6rh"
},
{
"name": "type",
"value": "agency"
},
{
"name": "role",
"value": "admin"
},
{
"name": "ids",
"value": "5DP4iH6HLkQsiKESj6rh,5DP4iH6HLkQsiKESj34h"
},
{
"name": "sort",
"value": "dateAdded"
},
{
"name": "sortDirection",
"value": "asc"
},
{
"name": "enabled2waySync",
"value": "VALUE"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `companyId` | Query | `string` | ✅ | Company ID in which the search needs to be performed [example: `5DP41231LkQsiKESj6rh`] |
| `query` | Query | `string` | — | The search term for the user is matched based on the user full name, email or phone [example: `Jo... |
| `skip` | Query | `string` | — | No of results to be skipped before returning the result [example: `1`] |
| `limit` | Query | `string` | — | No of results to be limited before returning the result [example: `10`] |
| `locationId` | Query | `string` | — | Location ID in which the search needs to be performed [example: `5DP41231LkQsiKESj6rh`] |
| `type` | Query | `string` | — | Type of the users to be filtered in the search [example: `agency`] |
| `role` | Query | `string` | — | Role of the users to be filtered in the search [example: `admin`] |
| `ids` | Query | `string` | — | List of User IDs to be filtered in the search [example: `5DP4iH6HLkQsiKESj6rh,5DP4iH6HLkQsiKESj34h`] |
| `sort` | Query | `string` | — | The field on which sort is applied in which the results need to be sorted. Default is based on th... |
| `sortDirection` | Query | `string` | — | The direction in which the results need to be sorted [example: `asc`] |
| `enabled2waySync` | Query | `boolean` | — | |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **users** (array of UserSchema)<br> - **count** (number) (e.g. `1231`) |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## POST /users/search/filter-by-email
**Summary:** Filter Users by Email
Filter users by company ID, deleted status, and email array
**Version Header:** `2021-07-28`
**Operation ID:** `filter-users-by-email`
**Tags:** Search
### cURL
```bash
curl -X POST 'https://rest.gohighlevel.com/v1/users/search/filter-by-email' \
-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' \
-d '{}' # See request body schema below
```
### Python (http.client)
```python
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',
}
payload = json.dumps({})
conn.request('POST', '/v1/users/search/filter-by-email', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - POST filter-by-email",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://rest.gohighlevel.com/v1/users/search/filter-by-email",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Body Schema
- **companyId** (string) (required) (e.g. `5DP41231LkQsiKESj6rh`): Company ID to filter users
- **emails** (string) (required) (e.g. `user1@example.com,user2@example.com`): Comma-separated list of email addresses to filter users
- **deleted** (boolean) (e.g. `False`): Filter deleted users
- **skip** (string) (e.g. `1`): No of results to be skipped before returning the result
- **limit** (string) (e.g. `10`): No of results to be limited before returning the result
- **projection** (string) (e.g. `all`): Projection fields to return. Use "all" for all fields, or specify comma-separated field names. Default returns only id and email
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **users** (array of UserSchema)<br> - **count** (number) (e.g. `1231`) |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
> 📌 **POST for Search:** Search endpoints use POST instead of GET because the search filters are complex JSON objects that can't be easily encoded in query parameters.
---
## DELETE /users/{userId}
**Summary:** Delete User
Delete User
**Version Header:** `2021-07-28`
**Operation ID:** `delete-user`
**Tags:** Users
### cURL
```bash
curl -X DELETE 'https://rest.gohighlevel.com/v1/users/{userId}' \
-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)
```python
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('DELETE', '/v1/users/{userId}', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - DELETE {userId}",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "DELETE",
"url": "https://rest.gohighlevel.com/v1/users/{userId}",
"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:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **succeded** (boolean) (e.g. `True`)<br> - **message** (string) (e.g. `Queued deleting user with e-mail john@deo.com and name John Deo. Will take... |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
> ⚠️ **Async Delete:** User deletion is asynchronous. The API returns `202 Accepted` but the user may not be deleted immediately.
---
## GET /users/{userId}
**Summary:** Get User
Get User
**Version Header:** `2021-07-28`
**Operation ID:** `get-user`
**Tags:** Users
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/users/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)
```python
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/users/ve9EPM428h8vShlRW1KT', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET ve9EPM428h8vShlRW1KT",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/users/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:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `userId` | Path | `string` | ✅ | User Id [example: `ve9EPM428h8vShlRW1KT`] |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **id** (string) (e.g. `0IHuJvc2ofPAAA8GzTRi`)<br> - **name** (string) (e.g. `John Deo`)<br> - **firstName** (string) (e.g. `John`)<br> - **lastName**... |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
## PUT /users/{userId}
**Summary:** Update User
Update User
**Version Header:** `2021-07-28`
**Operation ID:** `update-user`
**Tags:** Users
### cURL
```bash
curl -X PUT 'https://rest.gohighlevel.com/v1/users/{userId}' \
-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' \
-d '{}' # See request body schema below
```
### Python (http.client)
```python
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',
}
payload = json.dumps({})
conn.request('PUT', '/v1/users/{userId}', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - PUT {userId}",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "PUT",
"url": "https://rest.gohighlevel.com/v1/users/{userId}",
"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": true,
"bodyParameters": {
"parameters": []
},
"options": {}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Body Schema
- **firstName** (string) (e.g. `John`)
- **lastName** (string) (e.g. `Deo`)
- **email** (string) (e.g. `john@deo.com`): Email update is no longer supported due to security reasons.
- **password** (string) (e.g. `*******`)
- **phone** (string) (e.g. `+18832327657`)
- **type** (string) (e.g. `account`)
- **role** (string) (e.g. `admin`)
- **companyId** (string) (e.g. `UAXssdawIWAWD`): Company/Agency Id. Required for Agency Level access
- **locationIds** (array) (e.g. `['C2QujeCh8ZnC7al2InWR']`)
- **permissions** (PermissionsDto)
- **scopes** (array) (e.g. `['contacts.write', 'campaigns.readonly']`): Scopes allowed for users. Only scopes that have been passed will be enabled. If passed empty all the scopes will be get disabled
- **scopesAssignedToOnly** (array) (e.g. `['contacts.write', 'campaigns.readonly']`): Assigned Scopes allowed for users. Only scopes that have been passed will be enabled. If passed empty all the assigned scopes will be get disabled
- **profilePhoto** (string) (e.g. `https://img.png`)
- **twilioPhone** (object) (e.g. `{'C2QujeCh8ZnC7al2InWR': '+18832327657', 'M2QrtfVt8ZnC7cv2InDL': '+18832327657'}`): Per-location inbound Twilio number in E.164 format, keyed by location id (Call and Voicemail Inbound Number for direct Twilio, not LC Phone). Replacement semantics: if you send twilioPhone in the request body, the stored map is replaced entirely with this object (not merged). Any location id omitted from the object is removed from the saved map. Omit the twilioPhone property entirely to leave existing numbers unchanged. Send an empty object {} to clear all per-location numbers. To clear a single location only, set that location id to an empty string "".
- **platformLanguage** (string) (e.g. `en_US`): Platform language preference for the user
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **id** (string) (e.g. `0IHuJvc2ofPAAA8GzTRi`)<br> - **name** (string) (e.g. `John Deo`)<br> - **firstName** (string) (e.g. `John`)<br> - **lastName**... |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
*Documentation generated from GHL OpenAPI specifications. Verify against official docs for latest changes.*
+145
View File
@@ -0,0 +1,145 @@
# GHL Workflows API
**Endpoints:** 1
**Base URL:** `https://rest.gohighlevel.com/v1`
**Version Header(s):** `2021-07-28`
---
## Endpoints
- [GET /workflows/](#get--workflows-) — Get Workflow
---
## GET /workflows/
**Summary:** Get Workflow
Get Workflow
**Version Header:** `2021-07-28`
**Operation ID:** `get-workflow`
**Tags:** Workflows
### cURL
```bash
curl -X GET 'https://rest.gohighlevel.com/v1/workflows/?locationId=VALUE' \
-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)
```python
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/workflows/?locationId=VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
```
### n8n HTTP Node
```json
{
"name": "GHL - GET workflows",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/workflows/",
"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": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "locationId",
"value": "VALUE"
}
]
}
}
}
```
**To use in n8n:**
1. Add an HTTP Request node
2. Switch to JSON mode (Parameters → use RAW JSON)
3. Paste the JSON above
4. Update `YOUR_API_TOKEN` with your actual GHL API key
### Request Parameters
| Name | Location | Type | Required | Description |
|------|----------|------|----------|-------------|
| `locationId` | Query | `string` | ✅ | |
### Response Codes
| Code | Description | Schema |
|------|-------------|--------|
| `200` | Successful response | - **workflows** (array of WorkflowSchema) |
| `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-Agent` HTTP header. Requests without it may be rejected with a 403 error.
---
*Documentation generated from GHL OpenAPI specifications. Verify against official docs for latest changes.*