provider experiments POST
/api/projects/{project_id}/experiments/{id}/freeze_exposure/ @utdk/posthog
/api/projects/{project_id}/experiments/{id}/freeze_exposure/ experiments_freeze_exposure_create
Freeze exposure on a running experiment while metrics keep flowing.
Snapshots the already-exposed users into a static cohort and narrows the
linked feature flag so only those users keep matching — new users can no
longer enter the experiment. ``end_date`` is left null so long-term metrics
(revenue/LTV/renewals/retention) keep accumulating. Enrolled users keep
their assigned variant. The serialized status becomes 'exposure_frozen'.
Returns 400 if the experiment is not running, exposure is already frozen,
the experiment is group-aggregated (group flags cannot be frozen with a
person cohort), or the exposed set is too large to snapshot synchronously.
- id path required
- A unique integer value identifying this experiment.
- 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
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.experimentsFreezeExposureCreate()