provider cohorts GET
/api/projects/{project_id}/cohorts/ @utdk/posthog
/api/projects/{project_id}/cohorts/ cohorts_list
- basic query
- Return a basic payload that omits the heavy `filters`, `query`, and `groups` fields. Useful for pickers that only need id/name/count.
- boolean
- hide_behavioral_cohorts query
- Set true to exclude behavioral (event-based) cohorts, which can't be used in feature flags or batch workflow audiences.
- boolean
- limit query
- Number of results to return per page.
- integer
- offset query
- The initial index from which to return the results.
- integer
- project_id path required
- Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
- string
- search query
- Optional. Match against cohort `name`. Returns exact (case-insensitive substring) matches only; if no exact match exists, returns similar (fuzzy trigram — typos, transpositions, prefix-as-you-type) matches instead. Each result's `search_match_type` is `exact` or `similar`. Results are ordered by relevance. When omitted, cohorts are ordered newest-first. Capped at 200 characters; longer queries return a 400 error.
- string
Try it
Authentication
Configure credentials for PostHog API
Code snippet
Updates live as you fill in the form above.
TypeScript
import posthog from '@utdk/posthog';
await posthog.cohortsList()