Custom variables


The /reports/custom-variables endpoint returns distinct values for a given custom variable key, useful for populating filter dropdowns and exploring available segmentation options.

💡 Use case: Build dynamic filter UIs, discover available custom variable values, implement autocomplete for custom dimensions.

GET /reports/custom-variables

Returns a list of distinct values for a custom variable with usage counts.

Authentication

Required

Include your API key in the Authorization header:

curl https://api.growpanel.io/reports/custom-variables \
-H "Authorization: Bearer YOUR_API_KEY"

Query parameters

ParameterTypeDescription
keyrequiredstringThe custom variable key to retrieve values for (e.g., industry, channel, segment).
searchoptionalstringSearch term to filter values (autocomplete). Case-insensitive partial match.
limitoptionalintegerMaximum number of values to return. Defaults to 20. Maximum: 100.

Response

200 OK

Returns a list of values with customer counts.

{
"values": [
{ "value": "enterprise", "count": 45 },
{ "value": "startup", "count": 120 },
{ "value": "agency", "count": 30 }
]
}

Response fields

FieldTypeDescription
valuestringThe custom variable value
countintegerNumber of customers with this value

Example requests

Get all industry values

curl "https://api.growpanel.io/reports/custom-variables?key=industry" \
-H "Authorization: Bearer YOUR_API_KEY"

Search for industries containing "tech"

curl "https://api.growpanel.io/reports/custom-variables?key=industry&search=tech" \
-H "Authorization: Bearer YOUR_API_KEY"

Get top 50 channels

curl "https://api.growpanel.io/reports/custom-variables?key=channel&limit=50" \
-H "Authorization: Bearer YOUR_API_KEY"

Autocomplete for size segments

curl "https://api.growpanel.io/reports/custom-variables?key=size&search=small" \
-H "Authorization: Bearer YOUR_API_KEY"

Errors

400 Bad Request

Missing or invalid key parameter.

{
"error": "Missing required parameter: key"
}

401 Unauthorized

Invalid or missing API key.

{
"error": "Unauthorized"
}

Notes

  • Custom variables: Must be configured in your GrowPanel account and synced from your billing system
  • Sorting: Results are sorted by count (descending) to show most common values first
  • Search: The search parameter performs case-insensitive substring matching
  • Performance: Responses are cached for 5 minutes to improve performance
  • Common keys: Standard custom variable keys include industry, channel, size, segment, market