# 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.*