Update Cohort
Update an existing cohort in your project. You can modify the name, description, filters, or membership for both static and dynamic cohorts.Endpoint
Path Parameters
integer
required
The ID of the project containing the cohort
integer
required
The ID of the cohort to update
Request Body
All fields are optional. Only include fields you want to update.string
New name for the cohort
string
New description for the cohort
object
Updated filter criteria for dynamic cohorts. Must contain a
properties key.Note: Updating filters triggers recalculation of the cohort.object
Updated HogQL query for static cohorts created from queries
boolean
Set to
true to soft-delete the cohort, or false to restore a deleted cohortNote: Cohorts used in active feature flags, insights, or other cohorts cannot be deleted.file
CSV file to update membership of static cohorts. This replaces existing members.
Response Fields
integer
Unique identifier for the cohort
string
Name of the cohort
string
Description of the cohort
object
Filter criteria defining cohort membership
boolean
Whether this cohort is static or dynamic
integer
Number of users currently in the cohort
boolean
Whether the cohort is being recalculated
string
ISO 8601 timestamp of last calculation
integer
Version number of the cohort (increments on each update)
Examples
Update Cohort Name
Change the name and description of a cohort:Update Cohort Filters
Modify the filter criteria for a dynamic cohort:Update Static Cohort via CSV
Replace the members of a static cohort:Delete a Cohort
Soft-delete a cohort:Response
Error Responses
error
Invalid request body or validation errorExamples:
error
Invalid or missing API key
error
Insufficient permissions to update cohorts
error
Cohort not found
Notes
- Updating filters on a dynamic cohort triggers automatic recalculation
- You cannot delete cohorts that are:
- Used in active feature flags
- Referenced in other cohorts
- Used in insights
- Used in test account filters
- Behavioral filters cannot be added to cohorts used in feature flags
- Cohorts cannot form circular dependencies (cohort A referencing cohort B which references cohort A)
- Updating a static cohort via CSV replaces all existing members
- The
versionfield increments with each update - Set
deleted: falseto restore a previously deleted cohort