cohorts

get/api/projects/{project_id}/cohorts/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/cohorts/
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Query parameters

basicboolean

Return a basic payload that omits the query, groups, last_error_message, and experiment_set fields (filters is kept). Useful for pickers that only need id/name/count.

hide_behavioral_cohortsboolean

Set true to exclude behavioral (event-based) cohorts, which can't be used in feature flags or batch workflow audiences.

limitinteger

Number of results to return per page.

offsetinteger

The initial index from which to return the results.

searchstring

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.

Response

countinteger required
nextstring uri nullable
previousstring uri nullable

Changes

No recorded changes to this operation across all 1 revision of this API.