# List Campaigns

GET https://services.leadconnectorhq.com/affiliate-manager/{locationId}/campaigns

Retrieve the list of affiliate campaigns for a location.

## Authentication

Send `Authorization: Bearer <token>` using any one of:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `affiliate-manager.readonly`
- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `affiliate-manager.readonly`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `locationId` | string | Yes | Location Id |

### Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `query` | string | No | Filter campaigns whose name contains this text |
| `skip` | number | No | Number of campaigns to skip |
| `limit` | number | No | Number of campaigns to return, maximum 100 |
| `onlyActiveLiveMode` | boolean | No | Return only campaigns in live mode |
| `trackTypes` | array | No | Comma separated track types |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "2021-07-28"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/affiliate-manager/{locationId}/campaigns": {
      "get": {
        "summary": "List Campaigns",
        "operationId": "listCampaigns",
        "description": "Retrieve the list of affiliate campaigns for a location.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2021-07-28"
              ]
            }
          },
          {
            "name": "locationId",
            "required": true,
            "in": "path",
            "description": "Location Id",
            "schema": {
              "example": "ve9EPM428h8vShlRW1KT",
              "type": "string"
            }
          },
          {
            "name": "query",
            "required": false,
            "in": "query",
            "description": "Filter campaigns whose name contains this text",
            "schema": {
              "example": "Summer launch",
              "type": "string"
            }
          },
          {
            "name": "skip",
            "required": false,
            "in": "query",
            "description": "Number of campaigns to skip",
            "schema": {
              "minimum": 0,
              "default": 0,
              "example": 0,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of campaigns to return, maximum 100",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 10,
              "example": 10,
              "type": "number"
            }
          },
          {
            "name": "onlyActiveLiveMode",
            "required": false,
            "in": "query",
            "description": "Return only campaigns in live mode",
            "schema": {
              "default": false,
              "example": false,
              "type": "boolean"
            }
          },
          {
            "name": "trackTypes",
            "required": false,
            "in": "query",
            "description": "Comma separated track types",
            "schema": {
              "example": [
                "funnels",
                "websites"
              ],
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "forms",
                  "surveys",
                  "calenders",
                  "funnels",
                  "websites",
                  "store",
                  "external_source",
                  "community"
                ]
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCampaignsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "affiliate-manager.readonly"
            ]
          },
          {
            "Location-Access": [
              "affiliate-manager.readonly"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "ListCampaignsResponseDto": {
        "type": "object",
        "properties": {
          "campaigns": {
            "description": "Campaigns for the location",
            "example": [
              {
                "_id": "6385d230f6d19db03eef6fb2",
                "locationId": "ve9EPM428h8vShlRW1KT",
                "name": "Summer launch",
                "trackType": "funnels",
                "liveMode": true,
                "currency": "USD",
                "cookieLife": 30,
                "commissionType": "percentage",
                "commission": 10,
                "customer": 12,
                "leads": 34,
                "revenue": 1500,
                "commissionAmount": 150
              }
            ],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "_id": {
                  "type": "string",
                  "description": "Campaign id",
                  "example": "6385d230f6d19db03eef6fb2"
                },
                "locationId": {
                  "type": "string",
                  "description": "Location id the campaign belongs to",
                  "example": "ve9EPM428h8vShlRW1KT"
                },
                "name": {
                  "type": "string",
                  "description": "Campaign name",
                  "example": "Summer launch"
                },
                "description": {
                  "type": "string",
                  "description": "Campaign description",
                  "example": "Affiliate campaign for the summer launch"
                },
                "trackType": {
                  "type": "string",
                  "description": "What the campaign tracks",
                  "enum": [
                    "forms",
                    "surveys",
                    "calenders",
                    "funnels",
                    "websites",
                    "store",
                    "external_source",
                    "community"
                  ],
                  "example": "funnels"
                },
                "subTrackType": {
                  "type": "string",
                  "description": "Sub track type",
                  "enum": [
                    "lead",
                    "product",
                    "donation"
                  ],
                  "example": "product"
                },
                "liveMode": {
                  "type": "boolean",
                  "description": "Whether the campaign is live",
                  "example": true
                },
                "currency": {
                  "type": "string",
                  "description": "Campaign currency",
                  "example": "USD"
                },
                "payoutFrequency": {
                  "type": "string",
                  "description": "How often affiliates are paid out",
                  "enum": [
                    "PAY_7",
                    "PAY_15",
                    "PAY_30",
                    "PAY_45",
                    "PAY_60",
                    "PAY_90"
                  ],
                  "example": "PAY_30"
                },
                "cookieLife": {
                  "type": "number",
                  "description": "Referral cookie lifetime in days",
                  "example": 30
                },
                "commissionType": {
                  "type": "string",
                  "description": "First tier commission type",
                  "enum": [
                    "flat",
                    "percentage"
                  ],
                  "example": "percentage"
                },
                "commission": {
                  "type": "number",
                  "description": "First tier commission value",
                  "example": 10
                },
                "commissionTier": {
                  "type": "number",
                  "description": "Number of commission tiers",
                  "example": 1
                },
                "leadCommissionTier": {
                  "type": "number",
                  "description": "Number of lead commission tiers",
                  "example": 1
                },
                "isGlobalCommission": {
                  "type": "boolean",
                  "description": "Whether one commission applies to every product on the campaign",
                  "example": true
                },
                "secondTierCommissionType": {
                  "type": "string",
                  "description": "Second tier commission type",
                  "enum": [
                    "flat",
                    "percentage"
                  ],
                  "example": "percentage"
                },
                "secondTierCommission": {
                  "type": "number",
                  "description": "Second tier commission value",
                  "example": 5
                },
                "calculateSetupFee": {
                  "type": "boolean",
                  "description": "Whether setup fees count towards commission",
                  "example": false
                },
                "referralPermalink": {
                  "type": "string",
                  "description": "Referral link slug",
                  "example": "summer-launch"
                },
                "referralRealLink": {
                  "type": "string",
                  "description": "Full referral link",
                  "example": "https://example.com/summer-launch"
                },
                "domain": {
                  "type": "string",
                  "description": "Domain the referral link points at",
                  "example": "example.com"
                },
                "stepId": {
                  "type": "string",
                  "description": "Funnel or page step id being tracked",
                  "example": "6385d230f6d19db03eef6fb3"
                },
                "subAfLink": {
                  "type": "string",
                  "description": "Sub affiliate signup link",
                  "example": "https://example.com/sub-affiliate-signup"
                },
                "enableSubAffiliateLink": {
                  "type": "boolean",
                  "description": "Whether sub affiliate signup is enabled",
                  "example": false
                },
                "enableAutoEnrollSubAffiliate": {
                  "type": "boolean",
                  "description": "Whether sub affiliates are auto enrolled",
                  "example": true
                },
                "createdAt": {
                  "type": "string",
                  "description": "Campaign creation timestamp",
                  "example": "2026-01-01T00:00:00.000Z"
                },
                "updatedAt": {
                  "type": "string",
                  "description": "Campaign update timestamp",
                  "example": "2026-01-02T00:00:00.000Z"
                },
                "customer": {
                  "type": "number",
                  "description": "Customers attributed to the campaign",
                  "example": 12
                },
                "leads": {
                  "type": "number",
                  "description": "Leads attributed to the campaign",
                  "example": 34
                },
                "droppedOut": {
                  "type": "number",
                  "description": "Customers who dropped out",
                  "example": 2
                },
                "revenue": {
                  "type": "number",
                  "description": "Revenue attributed to the campaign",
                  "example": 1500
                },
                "commissionAmount": {
                  "type": "number",
                  "description": "Commission accrued on the campaign",
                  "example": 150
                }
              },
              "required": [
                "_id",
                "locationId",
                "name",
                "liveMode",
                "cookieLife"
              ],
              "title": "CampaignListItemResponseDto"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "example": {
              "count": 42
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "count": {
                    "type": "number",
                    "description": "Total campaigns matching the applied filters",
                    "example": 42
                  }
                },
                "required": [
                  "count"
                ],
                "title": "CampaignListMetaResponseDto"
              }
            ]
          }
        },
        "required": [
          "campaigns",
          "meta"
        ],
        "title": "ListCampaignsResponseDto"
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/affiliate-manager/<locationId>/campaigns' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: 2021-07-28'
```

**Node.js**

```javascript
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: '2021-07-28'
  }
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/affiliate-manager/<locationId>/campaigns', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/affiliate-manager/{locationId}/campaigns"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "2021-07-28"
}

response = requests.get(url, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/affiliate-manager/<locationId>/campaigns',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: 2021-07-28',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/affiliate-manager/<locationId>/campaigns")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "2021-07-28")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {
  url := "https://services.leadconnectorhq.com/affiliate-manager/<locationId>/campaigns"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "2021-07-28")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/affiliate-manager/<locationId>/campaigns")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "2021-07-28"

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "2021-07-28"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/affiliate-manager/<locationId>/campaigns' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
