# Get Agency Plans

GET https://services.leadconnectorhq.com/saas/agency-plans/{companyId}

Fetch all agency subscription plans for a given company ID

## Authentication

Send `Authorization: Bearer <token>` using:

- **Agency token: OAuth access token or Private Integration Token.** Scopes: `saas/company.read`

## Parameters

### Header Parameters

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

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `companyId` | string | Yes |  |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "v3"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/saas/agency-plans/{companyId}": {
      "get": {
        "summary": "Get Agency Plans",
        "operationId": "getAgencyPlans",
        "description": "Fetch all agency subscription plans for a given company ID",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          },
          {
            "name": "companyId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of agency subscription plans for the company.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAgencyPlansResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "Agency-Access": [
              "saas/company.read"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "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",
        "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",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "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",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "GetAgencyPlansResponse": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "planId": {
              "type": "string",
              "description": "Unique identifier for the plan",
              "example": "66c4d36534f21f900dc2a265"
            },
            "title": {
              "type": "string",
              "description": "Title of the plan",
              "example": "AED 1.5 changed"
            },
            "description": {
              "type": "string",
              "description": "Description of the plan",
              "example": "AED 1.5"
            },
            "saasProducts": {
              "description": "Array of SaaS products included in the plan",
              "example": [
                "2-way-text-messaging",
                "gmb-messaging",
                "web-chat",
                "reputation-management"
              ],
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "features": {
              "description": "Array of v2 feature-permission feature IDs included in the plan. This is the v2-native representation of the plan entitlements (the successor to `saasProducts`); the two are kept in sync via the plan create/update dual-write.",
              "example": [
                "contacts-conversations",
                "web-chat",
                "workflows"
              ],
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "addOns": {
              "description": "Array of add-ons included in the plan",
              "example": [
                "CONVERSATIONS_AI",
                "CP_BRANDED_APP_49",
                "WORDPRESS_V1"
              ],
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "planLevel": {
              "type": "number",
              "description": "Level of the plan (0-4)",
              "example": 0
            },
            "trialPeriod": {
              "type": "number",
              "description": "Trial period in days",
              "example": 16
            },
            "userLimit": {
              "type": "number",
              "description": "User limit for the plan",
              "example": 50
            },
            "contactLimit": {
              "type": "number",
              "description": "Contact limit for the plan",
              "example": 50
            },
            "prices": {
              "type": "array",
              "description": "Pricing information for the plan",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "description": "ID of the price",
                    "type": "string",
                    "example": "66a9edbfcc6c505a22db7976"
                  },
                  "billingInterval": {
                    "description": "Billing interval for the plan",
                    "type": "string",
                    "enum": [
                      "month",
                      "year"
                    ],
                    "example": "month"
                  },
                  "active": {
                    "description": "Indicates if the price is active",
                    "type": "boolean",
                    "example": true
                  },
                  "amount": {
                    "description": "Amount of the price",
                    "type": "number",
                    "example": 150
                  },
                  "currency": {
                    "description": "Currency of the price",
                    "type": "string",
                    "example": "AED"
                  },
                  "symbol": {
                    "description": "Symbol of the price",
                    "type": "string",
                    "example": "$"
                  }
                }
              }
            },
            "categoryId": {
              "type": "string",
              "description": "Category ID for the plan",
              "example": "66911cdc98508ec2731979b9"
            },
            "snapshotId": {
              "type": "string",
              "description": "Snapshot ID for the plan",
              "example": "G8KmpIeLnZc7ZMoJoxDx"
            },
            "productId": {
              "type": "string",
              "description": "Product ID for the plan",
              "example": "66a9edbfcc6c5090bedb7974"
            },
            "isSaaSV2": {
              "type": "boolean",
              "description": "Indicates if this is a SaaS V2 plan",
              "example": true
            },
            "providerLocationId": {
              "type": "string",
              "description": "Provider location ID",
              "example": "r06mdj4OrrERzYDvsOdh"
            },
            "createdAt": {
              "type": "string",
              "description": "Creation timestamp",
              "example": "2024-07-31T07:54:41.885Z"
            },
            "updatedAt": {
              "type": "string",
              "description": "Last update timestamp",
              "example": "2025-04-01T12:27:29.167Z"
            }
          },
          "required": [
            "planId",
            "title",
            "description",
            "saasProducts",
            "planLevel",
            "trialPeriod",
            "prices",
            "isSaaSV2",
            "createdAt",
            "updatedAt"
          ],
          "title": "AgencyPlanResponseDto"
        }
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/saas/agency-plans/<companyId>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3'
```

**Node.js**

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

try {
  const response = await fetch('https://services.leadconnectorhq.com/saas/agency-plans/<companyId>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/saas/agency-plans/{companyId}"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "v3"
}

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/saas/agency-plans/<companyId>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
  ],
]);

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

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/saas/agency-plans/<companyId>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .asString();
```

**Go**

```go
package main

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

func main() {
  url := "https://services.leadconnectorhq.com/saas/agency-plans/<companyId>"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "v3")

  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/saas/agency-plans/<companyId>")

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

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

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

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "v3"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/saas/agency-plans/<companyId>' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
