Get Specialized Cohort List
Endpoint
/o?method=get_cohort_list
Ⓔ Enterprise Only
This API is available exclusively in Countly Enterprise.
Overview
Retrieves a filtered list of cohorts with advanced options for pagination, sorting, searching, and custom field projection. Provides efficient cohort discovery across large numbers of cohorts.
Authentication
- Authentication methods:
- API Key (parameter):
api_key=YOUR_API_KEY - Auth Token (parameter):
auth_token=YOUR_AUTH_TOKEN - Auth Token (header):
countly-token: YOUR_AUTH_TOKEN
- API Key (parameter):
Permissions
- Required permission:
Readon thecohortsfeature
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes (or auth_token) | API key for authentication |
| auth_token | String | Yes (or api_key) | Auth token for authentication |
| app_id | String | Yes | Application identifier |
| type | String | No | Optional cohort type filter (manual or auto) |
Response
Success Response
{
"a60e8cc976840453894a590575712351": "DocAuditTemp"
}
Response Fields
| Field | Type | Description |
|---|---|---|
<cohort_id> | String | Cohort name keyed by cohort ID |
Error Responses
| HTTP Status | Error Response | Description |
|---|---|---|
| 400 | {"result": "Insufficient permissions"} | User lacks Read permission |
Behavior/Processing
- Validates read permission for
cohortsfeature. - Queries
cohortsbyapp_id(and optionaltype). - Applies visibility filter and excludes names starting with
[CLY]_. - Returns map object keyed by cohort ID with cohort name values.
Examples
Example 1: Get a filtered cohort list
Request:
curl -X GET "https://your-server.com/o?method=get_cohort_list" \
-d "api_key=YOUR_API_KEY" \
-d "app_id=YOUR_APP_ID" \
-d "type=manual"
Database Collections
| Collection | Used for | Data touched by this endpoint |
|---|---|---|
countly.cohorts | Collection: | Source of cohort list |
countly.cohortdata | Optional Collection: | Source of metrics if requested |
Limitations
- Returns only
_id -> namemapping, not full cohort documents.
Database Collections
countly.cohorts- Stores cohort definitions and metadata
Related Endpoints
- Get all cohorts - GET /o?method=get_cohorts
- Get single cohort - GET /o?method=get_cohort
Use Cases
- UI list display: Populate cohort selection dropdown with search
- Admin dashboard: Show paginated cohort list with sorting
- Bulk export: Export multiple cohorts with specific fields
- Cohort discovery: Find cohorts matching search criteria
- Analytics: Compare cohorts ranked by member count
Ⓔ Enterprise
This feature is part of Countly Enterprise.
Get Access:
Already a Customer? Use support portal if you have any questions
Last Updated
2026-02-16