πŸš€ More Vendrato tools: FunnelDupe β€’ GHL Utils
πŸ“Š

Get Opportunities from HighLevel

n8n-nodes-base.httpRequest

Retrieve opportunities from HighLevel CRM with filtering, sorting, and pagination. Perfect for syncing pipeline data and managing sales workflows.

crm highlevel opportunities sales api
App GoHighLevel
Category api integration
Version 1.0.0
Author Community
Credentials HighLevel OAuth2, HTTP Header Auth

πŸ’‘ Use Cases

πŸ“š API Documentation

Reference documentation for this API endpoint:

πŸ”— https://marketplace.gohighlevel.com/docs/ghl/opportunities/get-opportunity β†—

πŸ“‹ Node Configuration

{
  "nodes": [
    {
      "parameters": {
        "content": "## πŸ“Š Get Opportunities from HighLevel\n\n**Usage:**\nSearch and retrieve opportunities from your CRM pipeline with advanced filtering.\n\n**Required Input:**\n- `locationId`: Your HighLevel location ID\n\n**Optional Filters:**\n- `pipeline_id`: Filter by specific pipeline\n- `status`: Filter by status (open, won, lost, abandoned)\n- `pipeline_stage_id`: Filter by pipeline stage\n- Pagination: `limit` (default 20), `page`\n- Sorting and aggregations supported\n\n**Setup:**\n1. Configure GoHighLevel OAuth2 or HTTP Header Auth\n2. Customize filters in jsonBody to match your needs\n3. Node returns array of opportunities with details\n\n**Credential Setup (HTTP Header Auth):**\n1. In n8n, go to Credentials β†’ Add Credential\n2. Select \"Header Auth\"\n3. Set Name: `Authorization`\n4. Set Value: `Bearer YOUR_ACCESS_TOKEN`\n5. Get your token from GHL Settings β†’ Integrations β†’ Private Integrations",
        "height": 238,
        "width": 389,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        236
      ],
      "typeVersion": 1,
      "id": "sticky-get-opportunities",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://services.leadconnectorhq.com/opportunities/search",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Version",
              "value": "2021-07-28"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n    \"sort\": [\n        {\n            \"field\": \"date_added\",\n            \"direction\": \"desc\"\n        }\n    ],\n    \"query\": \"\",\n    \"locationId\": \"l2Y3WbrBsxoFLwZdBYfj\",\n    \"additionalDetails\": {\n        \"notes\": true,\n        \"tasks\": true,\n        \"calendarEvents\": true,\n        \"unReadConversations\": true\n    },\n    \"filters\": [\n        {\n            \"field\": \"pipeline_id\",\n            \"operator\": \"eq\",\n            \"value\": \"GFWKBm65RTNgD4z1W0XT\"\n        },\n        {\n            \"field\": \"status\",\n            \"operator\": \"eq\",\n            \"value\": [\n                \"open\"\n            ]\n        },\n        {\n            \"field\": \"pipeline_stage_id\",\n            \"operator\": \"eq\",\n            \"value\": \"9fa3a629-1309-4f8a-905e-2256e39429ab\"\n        }\n    ],\n    \"limit\": 20,\n    \"page\": 1,\n    \"aggregations\": [\n        {\n            \"name\": \"pipeline_stages\",\n            \"type\": \"terms\",\n            \"field\": \"pipeline_stage_id\",\n            \"size\": 100,\n            \"aggregations\": [\n                {\n                    \"name\": \"revenues\",\n                    \"type\": \"sum\",\n                    \"field\": \"monetary_value\"\n                }\n            ]\n        }\n    ],\n    \"includeTopRelations\": false\n}",
        "options": {}
      },
      "id": "de30f30d-f42c-4d4d-8afd-fd5b9e62b793",
      "name": "Get Opportunities",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        -496,
        304
      ],
      "credentials": {
        "highLevelOAuth2Api": {
          "id": "Ygt73rrBjccOWFSh",
          "name": "HighLevel account"
        },
        "httpHeaderAuth": {
          "id": "K5CrIgXNdFgOpH8d",
          "name": "GHL_MCP Header Auth"
        }
      }
    }
  ],
  "connections": {},
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "751aeba95f3d1aebe5a6ebe9d20293dd6c0f61b00ef369c580f0dc54913f5fcb"
  }
}
[
  {
    "id": "c7d95f3e-eab9-4141-b0d8-bd1eb918958b",
    "meta": {
      "name": "API Call Node",
      "id": "api-call",
      "icon": {
        "svg": "",
        "type": "SVG"
      },
      "description": "## πŸ“Š Get Opportunities from HighLevel  **Usage:**"
    },
    "label": "Get Opportunities",
    "dependencies": {
      "node-fetch": "3.3.2"
    },
    "script": "import fetch from \"node-fetch\";\nexport default async function apiCall({\n    url,\n    method,\n    contentType,\n    authorization,\n    body,\n    shouldAwait,\n    queryParams,\n    customHeaders\n}: NodeInputs, {\n    logging\n}: NodeScriptOptions) : NodeOutput  {\n    const headers = {\n        \"Content-Type\": contentType,\n        ...customHeaders\n    };\n    if (authorization) headers[\"Authorization\"] = authorization;\n\n    let queryParamsString = '';\n    if (queryParams) {\n        queryParamsString = '?' + new URLSearchParams(queryParams).toString();\n    }\n\n    const fetchOptions = {\n        method,\n        headers\n    };\n\n    if (method !== 'GET') {\n        fetchOptions.body = JSON.stringify(body);\n    }\n\n    const fetchPromise = fetch(url + queryParamsString, fetchOptions);\n\n    if (!shouldAwait) {\n        return {\n            data: null\n        };\n    }\n\n    const response = await fetchPromise;\n    const data = await response.json();\n    return {\n        status: response.status,\n        data\n    };\n}",
    "inputs": {
      "properties": {
        "method": {
          "type": "string",
          "description": "The HTTP method to use for the API call",
          "enum": [
            "GET",
            "POST",
            "PUT",
            "DELETE",
            "PATCH"
          ],
          "default": "POST",
          "title": "HTTP Method",
          "buildship": {
            "options": [
              {
                "label": "GET",
                "value": "GET"
              },
              {
                "value": "POST",
                "label": "POST"
              },
              {
                "value": "PUT",
                "label": "PUT"
              },
              {
                "label": "DELETE",
                "value": "DELETE"
              },
              {
                "label": "PATCH",
                "value": "PATCH"
              }
            ],
            "index": 0,
            "sensitive": false
          }
        },
        "url": {
          "description": "The URL of the API endpoint",
          "title": "URL",
          "type": "string",
          "buildship": {
            "index": 1
          }
        },
        "authorization": {
          "description": "The authorization header for the API call, if required (e.g., Bearer or Basic token)",
          "type": "string",
          "title": "Authorization",
          "buildship": {
            "sensitive": true,
            "index": 2
          }
        },
        "queryParams": {
          "default": {},
          "description": "The query parameters for the API call",
          "type": "object",
          "title": "Query Parameters",
          "buildship": {
            "index": 3,
            "sensitive": false
          }
        },
        "body": {
          "type": "object",
          "buildship": {
            "index": 4
          },
          "description": "The body to send with the API call",
          "title": "Body"
        },
        "contentType": {
          "enum": [
            "application/json",
            "application/x-www-form-urlencoded",
            "multipart/form-data",
            "text/plain"
          ],
          "description": "The content type of the API call",
          "title": "Content Type",
          "buildship": {
            "index": 5,
            "options": [
              {
                "label": "application/json",
                "value": "application/json"
              },
              {
                "value": "application/x-www-form-urlencoded",
                "label": "application/x-www-form-urlencoded"
              },
              {
                "label": "multipart/form-data",
                "value": "multipart/form-data"
              },
              {
                "label": "text/plain",
                "value": "text/plain"
              }
            ]
          },
          "type": "string"
        },
        "shouldAwait": {
          "description": "Whether to wait for the request to complete or not",
          "title": "Await?",
          "type": "boolean",
          "buildship": {
            "sensitive": false,
            "index": 6
          }
        },
        "customHeaders": {
          "type": "object",
          "description": "Additional custom headers for the API call",
          "title": "Custom Headers",
          "buildship": {
            "index": 7,
            "sensitive": false
          }
        }
      },
      "type": "object",
      "required": [
        "url",
        "shouldAwait",
        "method"
      ]
    },
    "integrations": [],
    "name": "API Call Node",
    "output": {
      "buildship": {},
      "properties": {
        "status": {
          "buildship": {
            "index": 0
          },
          "type": "number",
          "description": "The HTTP status of the API response",
          "title": "Status"
        },
        "data": {
          "buildship": {
            "index": 1
          },
          "title": "Data",
          "type": "object",
          "description": "The data object from the API response"
        }
      },
      "type": "object"
    },
    "isCollapsed": false,
    "type": "script",
    "values": {
      "method": "POST",
      "url": "https://services.leadconnectorhq.com/opportunities/search",
      "authorization": {
        "_$expression_": "`Bearer ${(await getSecret(\"ANONYMIZED_SECRET\"))}`",
        "type": "javascript",
        "hasErrors": false
      },
      "queryParams": {},
      "body": {
        "_$expression_": "{\n    \"sort\": [\n        {\n            \"field\": \"date_added\",\n            \"direction\": \"desc\"\n        }\n    ],\n    \"query\": \"\",\n    \"locationId\": \"l2Y3WbrBsxoFLwZdBYfj\",\n    \"additionalDetails\": {\n        \"notes\": true,\n        \"tasks\": true,\n        \"calendarEvents\": true,\n        \"unReadConversations\": true\n    },\n    \"filters\": [\n        {\n            \"field\": \"pipeline_id\",\n            \"operator\": \"eq\",\n            \"value\": \"GFWKBm65RTNgD4z1W0XT\"\n        },\n        {\n            \"field\": \"status\",\n            \"operator\": \"eq\",\n            \"value\": [\n                \"open\"\n            ]\n        },\n        {\n            \"field\": \"pipeline_stage_id\",\n            \"operator\": \"eq\",\n            \"value\": \"9fa3a629-1309-4f8a-905e-2256e39429ab\"\n        }\n    ],\n    \"limit\": 20,\n    \"page\": 1,\n    \"aggregations\": [\n        {\n            \"name\": \"pipeline_stages\",\n            \"type\": \"terms\",\n            \"field\": \"pipeline_stage_id\",\n            \"size\": 100,\n            \"aggregations\": [\n                {\n                    \"name\": \"revenues\",\n                    \"type\": \"sum\",\n                    \"field\": \"monetary_value\"\n                }\n            ]\n        }\n    ],\n    \"includeTopRelations\": false\n}",
        "type": "javascript",
        "hasErrors": false
      },
      "contentType": "application/json",
      "shouldAwait": true,
      "customHeaders": {
        "Version": "2021-07-28",
        "Content-Type": "application/json"
      }
    }
  }
]
{
  "subflows": [
    {
      "flow": [
        {
          "id": 740,
          "module": "http:ActionSendDataBasicAuth",
          "version": 3,
          "parameters": {
            "key": "ANONYMIZED_CREDENTIALS",
            "handleErrors": false,
            "useNewZLibDeCompress": true
          },
          "mapper": {
            "ca": "",
            "qs": [],
            "url": "https://services.leadconnectorhq.com/opportunities/search",
            "data": "{\n    \"sort\": [\n        {\n            \"field\": \"date_added\",\n            \"direction\": \"desc\"\n        }\n    ],\n    \"query\": \"\",\n    \"locationId\": \"l2Y3WbrBsxoFLwZdBYfj\",\n    \"additionalDetails\": {\n        \"notes\": true,\n        \"tasks\": true,\n        \"calendarEvents\": true,\n        \"unReadConversations\": true\n    },\n    \"filters\": [\n        {\n            \"field\": \"pipeline_id\",\n            \"operator\": \"eq\",\n            \"value\": \"GFWKBm65RTNgD4z1W0XT\"\n        },\n        {\n            \"field\": \"status\",\n            \"operator\": \"eq\",\n            \"value\": [\n                \"open\"\n            ]\n        },\n        {\n            \"field\": \"pipeline_stage_id\",\n            \"operator\": \"eq\",\n            \"value\": \"9fa3a629-1309-4f8a-905e-2256e39429ab\"\n        }\n    ],\n    \"limit\": 20,\n    \"page\": 1,\n    \"aggregations\": [\n        {\n            \"name\": \"pipeline_stages\",\n            \"type\": \"terms\",\n            \"field\": \"pipeline_stage_id\",\n            \"size\": 100,\n            \"aggregations\": [\n                {\n                    \"name\": \"revenues\",\n                    \"type\": \"sum\",\n                    \"field\": \"monetary_value\"\n                }\n            ]\n        }\n    ],\n    \"includeTopRelations\": false\n}",
            "gzip": true,
            "method": "post",
            "headers": [
              {
                "name": "Version",
                "value": "2021-07-28"
              },
              {
                "name": "Content-Type",
                "value": "application/json"
              },
              {
                "name": "Authorization",
                "value": "Bearer {{ANONYMIZED_TOKEN}}"
              }
            ],
            "timeout": "",
            "useMtls": false,
            "bodyType": "raw",
            "contentType": "application/json",
            "serializeUrl": false,
            "shareCookies": false,
            "parseResponse": true,
            "followRedirect": true,
            "useQuerystring": false,
            "followAllRedirects": false,
            "rejectUnauthorized": true
          },
          "metadata": {
            "designer": {
              "x": 300,
              "y": 300,
              "name": "Get Opportunities from HighLevel"
            },
            "restore": {
              "expect": {
                "qs": {
                  "mode": "chose",
                  "items": []
                },
                "method": {
                  "mode": "chose",
                  "label": "POST"
                },
                "headers": {
                  "mode": "chose",
                  "items": [
                    null,
                    null,
                    null
                  ]
                },
                "bodyType": {
                  "label": "Raw"
                },
                "contentType": {
                  "label": "JSON (application/json)"
                }
              },
              "parameters": {
                "key": {
                  "label": "ANONYMIZED_CREDENTIALS"
                }
              }
            },
            "parameters": [
              {
                "name": "key",
                "type": "keychain:basicauth",
                "label": "Credentials",
                "required": true
              },
              {
                "name": "handleErrors",
                "type": "boolean",
                "label": "Evaluate all states as errors (except for 2xx and 3xx )",
                "required": true
              },
              {
                "name": "useNewZLibDeCompress",
                "type": "hidden"
              }
            ],
            "expect": [
              {
                "name": "url",
                "type": "url",
                "label": "URL",
                "required": true
              },
              {
                "name": "serializeUrl",
                "type": "boolean",
                "label": "Serialize URL",
                "required": true
              },
              {
                "name": "method",
                "type": "select",
                "label": "Method",
                "required": true,
                "validate": {
                  "enum": [
                    "get",
                    "head",
                    "post",
                    "put",
                    "patch",
                    "delete",
                    "options"
                  ]
                }
              },
              {
                "name": "headers",
                "spec": [
                  {
                    "name": "name",
                    "type": "text",
                    "label": "Name",
                    "required": true
                  },
                  {
                    "name": "value",
                    "type": "text",
                    "label": "Value"
                  }
                ],
                "type": "array",
                "label": "Headers"
              },
              {
                "name": "qs",
                "spec": [
                  {
                    "name": "name",
                    "type": "text",
                    "label": "Name",
                    "required": true
                  },
                  {
                    "name": "value",
                    "type": "text",
                    "label": "Value"
                  }
                ],
                "type": "array",
                "label": "Query String"
              },
              {
                "name": "bodyType",
                "type": "select",
                "label": "Body type",
                "validate": {
                  "enum": [
                    "raw",
                    "x_www_form_urlencoded",
                    "multipart_form_data"
                  ]
                }
              },
              {
                "name": "parseResponse",
                "type": "boolean",
                "label": "Parse response",
                "required": true
              },
              {
                "name": "contentType",
                "type": "select",
                "label": "Content type",
                "validate": {
                  "enum": [
                    "text/plain",
                    "application/json",
                    "application/xml",
                    "text/xml",
                    "text/html",
                    "custom"
                  ]
                }
              },
              {
                "name": "data",
                "type": "buffer",
                "label": "Request content"
              }
            ]
          }
        }
      ]
    }
  ],
  "metadata": {
    "version": 1
  }
}
← Browse all nodes