# Get Agency Plans

GET https://services.leadconnectorhq.com/saas-api/public-api/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.** No scopes required.

## Parameters

### Header Parameters

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

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `companyId` | string | Yes | Company ID to get agency plans for |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "2021-04-15"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/saas-api/public-api/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": [
                "2021-04-15"
              ]
            }
          },
          {
            "name": "companyId",
            "required": true,
            "in": "path",
            "description": "Company ID to get agency plans for",
            "example": "5DP4iH6HLkQsiKESj6rh",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agency plans retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAgencyPlansResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceNotFoundDTO"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "Agency-Access": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "token-id",
        "in": "header",
        "description": "Use the Access Token generated by exchanging API Key for token id",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Location",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Company",
        "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"
              }
            },
            "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"
        }
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400,
            "description": "Status code"
          },
          "message": {
            "type": "string",
            "example": "Bad Request",
            "description": "Error message"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401,
            "description": "Status code"
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid",
            "description": "Error message"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized",
            "description": "Error message"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "ResourceNotFoundDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 404,
            "description": "Status code"
          },
          "message": {
            "type": "string",
            "example": [
              "Contact not found",
              "User not found",
              "Group not found",
              "Channel not found"
            ],
            "description": "Error message"
          }
        },
        "title": "ResourceNotFoundDTO"
      },
      "InternalServerErrorDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 500,
            "description": "Status code"
          },
          "message": {
            "type": "string",
            "example": "Internal Server Error",
            "description": "Error message"
          }
        },
        "title": "InternalServerErrorDTO"
      }
    }
  }
}
```

## HighLevel SDK Examples

**Node.js** (`@gohighlevel/api-client`)

```javascript
import HighLevel from '@gohighlevel/api-client';

const ghl = new HighLevel({
  privateIntegrationToken: '<PRIVATE_INTEGRATION_TOKEN>'
});

const response = await ghl.saasApi.getAgencyPlans('<COMPANYID>');
console.log(response);
```

**Python** (`gohighlevel-api-client`)

```python
from highlevel import HighLevel

client = HighLevel(
    private_integration_token='<PRIVATE_INTEGRATION_TOKEN>'
)

response = await client.saasApi.get_agency_plans('<COMPANYID>')
print(response)
```

**PHP** (`gohighlevel/api-client`)

```php
<?php
require_once 'vendor/autoload.php';

use HighLevel\HighLevel;
use HighLevel\HighLevelConfig;

$config = new HighLevelConfig([
    'privateIntegrationToken' => '<PRIVATE_INTEGRATION_TOKEN>'
]);
$ghl = new HighLevel($config);

$response = $ghl->saasApi->getAgencyPlans('<COMPANYID>');
echo json_encode($response, JSON_PRETTY_PRINT);
```

## Code Examples

**cURL**

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

**Node.js**

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

try {
  const response = await fetch('https://services.leadconnectorhq.com/saas-api/public-api/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-api/public-api/agency-plans/{companyId}"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "2021-04-15"
}

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

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

**Java**

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

**Go**

```go
package main

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

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

  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-api/public-api/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"] = "2021-04-15"

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

**PowerShell**

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

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