36 KiB
GHL Associations API
Endpoints: 10
Base URL: https://rest.gohighlevel.com/v1
Version Header(s): 2021-07-28
Endpoints
- GET /associations/ — Get all associations for a sub-account / location
- POST /associations/ — Create Association
- GET /associations/key/{key_name} — Get association key by key name
- GET /associations/objectKey/{objectKey} — Get association by object keys
- POST /associations/relations — Create Relation for you associated entities.
- GET /associations/relations/{recordId} — Get all relations By record Id
- DELETE /associations/relations/{relationId} — Delete Relation
- DELETE /associations/{associationId} — Delete Association
- GET /associations/{associationId} — Get association by ID
- PUT /associations/{associationId} — Update Association By Id
GET /associations/
Summary: Get all associations for a sub-account / location
Get all Associations
Version Header: 2021-07-28
Operation ID: find-associations
Tags: Associations
cURL
curl -X GET 'https://rest.gohighlevel.com/v1/associations/?locationId=string&skip=10&limit=100' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'User-Agent: YourApp/1.0'
Python (http.client)
import http.client
import json
conn = http.client.HTTPSConnection('rest.gohighlevel.com')
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Version': '2021-07-28',
'Content-Type': 'application/json',
'Accept': 'application/json',
'User-Agent': 'YourApp/1.0',
}
conn.request('GET', '/v1/associations/?locationId=string&skip=10&limit=100', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
n8n HTTP Node
{
"name": "GHL - GET associations",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/associations/",
"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": "string"
},
{
"name": "skip",
"value": "10"
},
{
"name": "limit",
"value": "100"
}
]
}
}
}
To use in n8n:
- Add an HTTP Request node
- Switch to JSON mode (Parameters → use RAW JSON)
- Paste the JSON above
- Update
YOUR_API_TOKENwith your actual GHL API key
Request Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
locationId |
Query | string |
✅ | [example: string] |
skip |
Query | number |
✅ | [example: 10] |
limit |
Query | number |
✅ | [example: 100] |
Response Codes
| Code | Description | Schema |
|---|---|---|
200 |
Successful response | - locationId (string) (required) (e.g. string)- id (string) (required) (e.g. ve9EPM428h8vShlRW1KT)- key (string) (required)... |
400 |
Bad Request | Standard error response for bad requests (400). Contains message, statusCode fields. |
401 |
Unauthorized | Standard error response for unauthorized requests (401). Contains message, statusCode fields. |
422 |
Unprocessable Entity | Standard error response for unprocessable entity (422). Contains message, statusCode, errors array fields. |
⚠️ Special Notes & Quirks
⚠️ User-Agent Required: All GHL API requests require a
User-AgentHTTP header. Requests without it may be rejected with a 403 error.
POST /associations/
Summary: Create Association
Allow you to create contact - contact , contact - custom objects associations, will add more in the future.Documentation Link - https://doc.clickup.com/8631005/d/h/87cpx-293776/cd0f4122abc04d3
Version Header: 2021-07-28
Operation ID: create-association
Tags: Associations
cURL
curl -X POST 'https://rest.gohighlevel.com/v1/associations/' \
-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)
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/associations/', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
n8n HTTP Node
{
"name": "GHL - POST associations",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://rest.gohighlevel.com/v1/associations/",
"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:
- Add an HTTP Request node
- Switch to JSON mode (Parameters → use RAW JSON)
- Paste the JSON above
- Update
YOUR_API_TOKENwith your actual GHL API key
Request Body Schema
- locationId (string) (required) (e.g.
string) - key (string) (required) (e.g.
student_teacher): Association's Unique key - firstObjectLabel (object) (required) (e.g.
student): First Objects Association Label (custom_objects.children) - firstObjectKey (object) (required) (e.g.
custom_objects.children): First Objects Key - secondObjectLabel (object) (required) (e.g.
Teacher): Second Object Association Label (contact) - secondObjectKey (object) (required) (e.g.
contact): Second Objects Key
Response Codes
| Code | Description | Schema |
|---|---|---|
201 |
Successful response | - locationId (string) (required) (e.g. string)- id (string) (required) (e.g. ve9EPM428h8vShlRW1KT)- key (string) (required)... |
400 |
Bad Request | Standard error response for bad requests (400). Contains message, statusCode fields. |
401 |
Unauthorized | Standard error response for unauthorized requests (401). Contains message, statusCode fields. |
422 |
Unprocessable Entity | Standard error response for unprocessable entity (422). Contains message, statusCode, errors array fields. |
⚠️ Special Notes & Quirks
⚠️ User-Agent Required: All GHL API requests require a
User-AgentHTTP header. Requests without it may be rejected with a 403 error.
GET /associations/key/{key_name}
Summary: Get association key by key name
Using this api you can get standard / user defined association by key
Version Header: 2021-07-28
Operation ID: get-association-key-by-key-name
Tags: Associations
cURL
curl -X GET 'https://rest.gohighlevel.com/v1/associations/key/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)
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/associations/key/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
{
"name": "GHL - GET VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/associations/key/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:
- Add an HTTP Request node
- Switch to JSON mode (Parameters → use RAW JSON)
- Paste the JSON above
- Update
YOUR_API_TOKENwith your actual GHL API key
Request Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
key_name |
Path | string |
✅ | |
locationId |
Query | string |
✅ |
Response Codes
| Code | Description | Schema |
|---|---|---|
200 |
Successful response | - locationId (string) (required) (e.g. string)- id (string) (required) (e.g. ve9EPM428h8vShlRW1KT)- key (string) (required)... |
400 |
Bad Request | Standard error response for bad requests (400). Contains message, statusCode fields. |
401 |
Unauthorized | Standard error response for unauthorized requests (401). Contains message, statusCode fields. |
422 |
Unprocessable Entity | Standard error response for unprocessable entity (422). Contains message, statusCode, errors array fields. |
⚠️ Special Notes & Quirks
⚠️ User-Agent Required: All GHL API requests require a
User-AgentHTTP header. Requests without it may be rejected with a 403 error.
GET /associations/objectKey/{objectKey}
Summary: Get association by object keys
Get association by object keys like contacts, custom objects and opportunities. Documentation Link - https://doc.clickup.com/8631005/d/h/87cpx-293776/cd0f4122abc04d3
Version Header: 2021-07-28
Operation ID: get-association-by-object-keys
Tags: Associations
cURL
curl -X GET 'https://rest.gohighlevel.com/v1/associations/objectKey/custom_objects.car?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)
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/associations/objectKey/custom_objects.car?locationId=ve9EPM428h8vShlRW1KT', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
n8n HTTP Node
{
"name": "GHL - GET custom_objects.car",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/associations/objectKey/custom_objects.car",
"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:
- Add an HTTP Request node
- Switch to JSON mode (Parameters → use RAW JSON)
- Paste the JSON above
- Update
YOUR_API_TOKENwith your actual GHL API key
Request Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
objectKey |
Path | string |
— | [example: custom_objects.car] |
locationId |
Query | string |
— | [example: ve9EPM428h8vShlRW1KT] |
Response Codes
| Code | Description | Schema |
|---|---|---|
200 |
Successful response | - locationId (string) (required) (e.g. string)- id (string) (required) (e.g. ve9EPM428h8vShlRW1KT)- key (string) (required)... |
400 |
Bad Request | Standard error response for bad requests (400). Contains message, statusCode fields. |
401 |
Unauthorized | Standard error response for unauthorized requests (401). Contains message, statusCode fields. |
422 |
Unprocessable Entity | Standard error response for unprocessable entity (422). Contains message, statusCode, errors array fields. |
⚠️ Special Notes & Quirks
⚠️ User-Agent Required: All GHL API requests require a
User-AgentHTTP header. Requests without it may be rejected with a 403 error.
POST /associations/relations
Summary: Create Relation for you associated entities.
Create Relation.Documentation Link - https://doc.clickup.com/8631005/d/h/87cpx-293776/cd0f4122abc04d3
Version Header: 2021-07-28
Operation ID: create-relation
Tags: Relations
cURL
curl -X POST 'https://rest.gohighlevel.com/v1/associations/relations' \
-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)
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/associations/relations', body=payload, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
n8n HTTP Node
{
"name": "GHL - POST relations",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://rest.gohighlevel.com/v1/associations/relations",
"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:
- Add an HTTP Request node
- Switch to JSON mode (Parameters → use RAW JSON)
- Paste the JSON above
- Update
YOUR_API_TOKENwith your actual GHL API key
Request Body Schema
- locationId (string) (required) (e.g.
clF1LD04GTUKN3b3XuOj): Your Sub Account's ID - associationId (string) (required) (e.g.
ve9EPM428h8vShlRW1KT): Association's Id - firstRecordId (string) (required) (e.g.
ve9EPM428h8vShlRW1KT): First Record's Id. For instance, if you have an association between a contact and a custom object, and you specify the contact as the first object while creating the association, then your firstRecordId would be the contactId - secondRecordId (string) (required) (e.g.
ve9EPM428h8vShlRW1KT): Second Record's Id.For instance, if you have an association between a contact and a custom object, and you specify the custom object as the second entity while creating the association, then your secondRecordId would be the customObject record Id
Response Codes
| Code | Description | Schema |
|---|---|---|
201 |
Successful response | - locationId (string) (required) (e.g. string)- id (string) (required) (e.g. ve9EPM428h8vShlRW1KT)- key (string) (required)... |
400 |
Bad Request | Standard error response for bad requests (400). Contains message, statusCode fields. |
401 |
Unauthorized | Standard error response for unauthorized requests (401). Contains message, statusCode fields. |
422 |
Unprocessable Entity | Standard error response for unprocessable entity (422). Contains message, statusCode, errors array fields. |
⚠️ Special Notes & Quirks
⚠️ User-Agent Required: All GHL API requests require a
User-AgentHTTP header. Requests without it may be rejected with a 403 error.
GET /associations/relations/{recordId}
Summary: Get all relations By record Id
Get all relations by record Id
Version Header: 2021-07-28
Operation ID: get-relations-by-record-id
Tags: Relations
cURL
curl -X GET 'https://rest.gohighlevel.com/v1/associations/relations/VALUE?locationId=clF1LD04GTUKN3b3XuOj&skip=10&limit=100&associationIds=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)
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/associations/relations/VALUE?locationId=clF1LD04GTUKN3b3XuOj&skip=10&limit=100&associationIds=VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
n8n HTTP Node
{
"name": "GHL - GET VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/associations/relations/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": "clF1LD04GTUKN3b3XuOj"
},
{
"name": "skip",
"value": "10"
},
{
"name": "limit",
"value": "100"
},
{
"name": "associationIds",
"value": "VALUE"
}
]
}
}
}
To use in n8n:
- Add an HTTP Request node
- Switch to JSON mode (Parameters → use RAW JSON)
- Paste the JSON above
- Update
YOUR_API_TOKENwith your actual GHL API key
Request Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
recordId |
Path | string |
✅ | |
locationId |
Query | string |
✅ | Your Sub Account's ID [example: clF1LD04GTUKN3b3XuOj] |
skip |
Query | number |
✅ | [example: 10] |
limit |
Query | number |
✅ | [example: 100] |
associationIds |
Query | array |
— | Association Ids |
Response Codes
| Code | Description | Schema |
|---|---|---|
200 |
Successful response | - locationId (string) (required) (e.g. string)- id (string) (required) (e.g. ve9EPM428h8vShlRW1KT)- key (string) (required)... |
400 |
Bad Request | Standard error response for bad requests (400). Contains message, statusCode fields. |
401 |
Unauthorized | Standard error response for unauthorized requests (401). Contains message, statusCode fields. |
422 |
Unprocessable Entity | Standard error response for unprocessable entity (422). Contains message, statusCode, errors array fields. |
⚠️ Special Notes & Quirks
⚠️ User-Agent Required: All GHL API requests require a
User-AgentHTTP header. Requests without it may be rejected with a 403 error.
DELETE /associations/relations/{relationId}
Summary: Delete Relation
Delete Relation
Version Header: 2021-07-28
Operation ID: delete-relation
Tags: Relations
cURL
curl -X DELETE 'https://rest.gohighlevel.com/v1/associations/relations/VALUE?locationId=clF1LD04GTUKN3b3XuOj' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'User-Agent: YourApp/1.0'
Python (http.client)
import http.client
import json
conn = http.client.HTTPSConnection('rest.gohighlevel.com')
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Version': '2021-07-28',
'Content-Type': 'application/json',
'Accept': 'application/json',
'User-Agent': 'YourApp/1.0',
}
conn.request('DELETE', '/v1/associations/relations/VALUE?locationId=clF1LD04GTUKN3b3XuOj', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
n8n HTTP Node
{
"name": "GHL - DELETE VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "DELETE",
"url": "https://rest.gohighlevel.com/v1/associations/relations/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": "clF1LD04GTUKN3b3XuOj"
}
]
}
}
}
To use in n8n:
- Add an HTTP Request node
- Switch to JSON mode (Parameters → use RAW JSON)
- Paste the JSON above
- Update
YOUR_API_TOKENwith your actual GHL API key
Request Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
relationId |
Path | string |
✅ | |
locationId |
Query | string |
✅ | Your Sub Account's ID [example: clF1LD04GTUKN3b3XuOj] |
Response Codes
| Code | Description | Schema |
|---|---|---|
200 |
Successful response | - locationId (string) (required) (e.g. string)- id (string) (required) (e.g. ve9EPM428h8vShlRW1KT)- key (string) (required)... |
400 |
Bad Request | Standard error response for bad requests (400). Contains message, statusCode fields. |
401 |
Unauthorized | Standard error response for unauthorized requests (401). Contains message, statusCode fields. |
422 |
Unprocessable Entity | Standard error response for unprocessable entity (422). Contains message, statusCode, errors array fields. |
⚠️ Special Notes & Quirks
⚠️ User-Agent Required: All GHL API requests require a
User-AgentHTTP header. Requests without it may be rejected with a 403 error.
DELETE /associations/{associationId}
Summary: Delete Association
Delete USER_DEFINED Association By Id, deleting an association will also all the relations for that association
Version Header: 2021-07-28
Operation ID: delete-association
Tags: Associations
cURL
curl -X DELETE 'https://rest.gohighlevel.com/v1/associations/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)
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/associations/VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
n8n HTTP Node
{
"name": "GHL - DELETE VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "DELETE",
"url": "https://rest.gohighlevel.com/v1/associations/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:
- Add an HTTP Request node
- Switch to JSON mode (Parameters → use RAW JSON)
- Paste the JSON above
- Update
YOUR_API_TOKENwith your actual GHL API key
Request Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
associationId |
Path | string |
✅ |
Response Codes
| Code | Description | Schema |
|---|---|---|
200 |
Successful response | - deleted (boolean) (required) (e.g. True): Deletion status- id (string) (required) (e.g. 6d6f6e676f5f6576656e7473): Association I... |
400 |
Bad Request | Standard error response for bad requests (400). Contains message, statusCode fields. |
401 |
Unauthorized | Standard error response for unauthorized requests (401). Contains message, statusCode fields. |
422 |
Unprocessable Entity | Standard error response for unprocessable entity (422). Contains message, statusCode, errors array fields. |
⚠️ Special Notes & Quirks
⚠️ User-Agent Required: All GHL API requests require a
User-AgentHTTP header. Requests without it may be rejected with a 403 error.
GET /associations/{associationId}
Summary: Get association by ID
Using this api you can get SYSTEM_DEFINED / USER_DEFINED association by id
Version Header: 2021-07-28
Operation ID: get-association-by-ID
Tags: Associations
cURL
curl -X GET 'https://rest.gohighlevel.com/v1/associations/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)
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/associations/VALUE', headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode())
print(json.dumps(data, indent=2))
conn.close()
n8n HTTP Node
{
"name": "GHL - GET VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "GET",
"url": "https://rest.gohighlevel.com/v1/associations/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:
- Add an HTTP Request node
- Switch to JSON mode (Parameters → use RAW JSON)
- Paste the JSON above
- Update
YOUR_API_TOKENwith your actual GHL API key
Request Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
associationId |
Path | string |
✅ |
Response Codes
| Code | Description | Schema |
|---|---|---|
200 |
Successful response | - locationId (string) (required) (e.g. string)- id (string) (required) (e.g. ve9EPM428h8vShlRW1KT)- key (string) (required)... |
400 |
Bad Request | Standard error response for bad requests (400). Contains message, statusCode fields. |
401 |
Unauthorized | Standard error response for unauthorized requests (401). Contains message, statusCode fields. |
422 |
Unprocessable Entity | Standard error response for unprocessable entity (422). Contains message, statusCode, errors array fields. |
⚠️ Special Notes & Quirks
⚠️ User-Agent Required: All GHL API requests require a
User-AgentHTTP header. Requests without it may be rejected with a 403 error.
PUT /associations/{associationId}
Summary: Update Association By Id
Update Association , Allows you to update labels of an associations. Documentation Link - https://doc.clickup.com/8631005/d/h/87cpx-293776/cd0f4122abc04d3
Version Header: 2021-07-28
Operation ID: update-association
Tags: Associations
cURL
curl -X PUT 'https://rest.gohighlevel.com/v1/associations/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)
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/associations/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
{
"name": "GHL - PUT VALUE",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "PUT",
"url": "https://rest.gohighlevel.com/v1/associations/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:
- Add an HTTP Request node
- Switch to JSON mode (Parameters → use RAW JSON)
- Paste the JSON above
- Update
YOUR_API_TOKENwith your actual GHL API key
Request Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
associationId |
Path | string |
✅ |
Request Body Schema
- firstObjectLabel (object) (required) (e.g.
student) - secondObjectLabel (object) (required) (e.g.
tutor)
Response Codes
| Code | Description | Schema |
|---|---|---|
200 |
Successful response | - locationId (string) (required) (e.g. string)- id (string) (required) (e.g. ve9EPM428h8vShlRW1KT)- key (string) (required)... |
400 |
Bad Request | Standard error response for bad requests (400). Contains message, statusCode fields. |
401 |
Unauthorized | Standard error response for unauthorized requests (401). Contains message, statusCode fields. |
422 |
Unprocessable Entity | Standard error response for unprocessable entity (422). Contains message, statusCode, errors array fields. |
⚠️ Special Notes & Quirks
⚠️ User-Agent Required: All GHL API requests require a
User-AgentHTTP header. Requests without it may be rejected with a 403 error.
Documentation generated from GHL OpenAPI specifications. Verify against official docs for latest changes.