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
The ID of the project containing the cohort
The ID of the cohort to update
Request Body
All fields are optional. Only include fields you want to update.New name for the cohort
New description for the cohort
Updated filter criteria for dynamic cohorts. Must contain a
properties key.Note: Updating filters triggers recalculation of the cohort.Updated HogQL query for static cohorts created from queries
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.CSV file to update membership of static cohorts. This replaces existing members.
Response Fields
Unique identifier for the cohort
Name of the cohort
Description of the cohort
Filter criteria defining cohort membership
Whether this cohort is static or dynamic
Number of users currently in the cohort
Whether the cohort is being recalculated
ISO 8601 timestamp of last calculation
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
Invalid request body or validation errorExamples:
Invalid or missing API key
Insufficient permissions to update cohorts
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