Hello,
I have noticed an issues using contact update GHL node.
Retreiving custom fields from lists works if the right scopes are defined.
These are the scope I use:
opportunities.readonly opportunities.write users.readonly locations.readonly locations/customValues.write locations/customFields.write calendars.write calendars/events.write calendars/groups.readonly calendars/events.readonly calendars/resources.write calendars.readonly socialplanner/post.readonly socialplanner/post.write workflows.readonly medias.readonly medias.write locations/customFields.readonly socialplanner/oauth.readonly socialplanner/oauth.write socialplanner/account.readonly contacts.readonly contacts.write
However, the request to update contact including custom fields doesn’t work.
It only works using a custom HTTP request.
This doesn’t work:
{
“nodes”: [
{
“parameters”: {
“operation”: “update”,
“contactId”: “={{ $(‘Webhook’).item.json.body.contact_id }}”,
“updateFields”: {
“customFields”: {
“values”: [
{
“fieldId”: {
“__rl”: true,
“value”: “WEWJooOAII3QBgrOy1Oy”,
“mode”: “list”,
“cachedResultName”: “Need”
},
“fieldValue”: “={{ $(‘need_ai_gen’).item.json.text }}”
}
]
}
},
“requestOptions”: {}
},
“type”: “n8n-nodes-base.highLevel”,
“typeVersion”: 2,
“position”: [
-1940,
1460
],
“id”: “4018bfbc-7713-4589-852b-835489b6bdaf”,
“name”: “HighLevel1”,
“credentials”: {
“highLevelOAuth2Api”: {
“id”: “qzLil7gkEUtpfeKt”,
“name”: “HighLevel Outbound calling Agent”
}
}
}
],
“connections”: {},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “2a877724f0669f36eb10a98e65f520962db9845ee37281fe85585b8f600c1c67”
}
}
This works:
{
“nodes”: [
{
“parameters”: {
“method”: “PUT”,
“url”: “=https://services.leadconnectorhq.com/contacts/{{ $(‘Webhook’).item.json.body.contact_id }}”,
“authentication”: “predefinedCredentialType”,
“nodeCredentialType”: “highLevelOAuth2Api”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “Accept”,
“value”: “application/json”
},
{
“name”: “Version”,
“value”: “2021-07-28”
}
]
},
“sendBody”: true,
“specifyBody”: “json”,
“jsonBody”: “={\n “tags”: [\n,\n “enriched”\n ],\n “customFields”: [\n {\n “id”: “26Hxj3wMixNvyS7rkmQr”,\n “key”: “contact.specific_service”,\n “field_value”: “{{ $(‘niche3’).item.json.text }}”\n },\n {\n “id”: “WEWJooOAII3QBgrOy1Oy”,\n “key”: “contact.need”,\n “field_value”: {{ JSON.stringify($(‘need_ai_gen’).item.json.text) }}\n },\n {\n “id”: “aVJ2fvZ2hA8Cpco94pbz”,\n “key”: “contact.niche”,\n “field_value”: “{{ $json.text }}”\n }\n ]\n}\n”,
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
-1880,
2200
],
“id”: “1bf7c19d-5b97-4a19-849d-103554e9239f”,
“name”: “Update Lead GHL”,
“credentials”: {
“highLevelOAuth2Api”: {
“id”: “bE4ipFYG3zbrjFQy”,
“name”: “HighLevel Voice AI Snapshot”
},
“highLevelApi”: {
“id”: “t1sCkVnSK3TQ6UlX”,
“name”: “HighLevel Outbound caller”
}
}
}
],
“connections”: {
“Update Lead GHL”: {
“main”: [
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “2a877724f0669f36eb10a98e65f520962db9845ee37281fe85585b8f600c1c67”
}
}
Thanks
Debug info
core
- n8nVersion: 1.78.1
- platform: docker (self-hosted)
- nodeJsVersion: 20.18.2
- database: postgres
- executionMode: regular
- concurrency: -1
- license: enterprise (production)
- consumerId: be566eb0-a279-4d8f-bf2d-844d7a68393e
storage
- success: all
- error: all
- progress: false
- manual: true
- binaryMode: filesystem