provider experiments POST /api/projects/{project_id}/experiments/{id}/metrics_recalculation/
@utdk/posthog /api/projects/{project_id}/experiments/{id}/metrics_recalculation/
experiments_metrics_recalculation_create
Trigger a batch recalculation of all metrics for this experiment. Returns 201 with the new pending recalculation, or 200 with the active one if a recalculation is already pending or in progress for this experiment. The response payload intentionally does not include the `results` array — at POST time the workflow has just been queued and no per-metric results exist yet. Clients should poll `GET metrics_recalculation/{id}/` for results as the workflow progresses.
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
experimentsMetricsRecalculationCreate
POST/api/projects/{project_id}/experiments/{id}/metrics_recalculation/
Trigger a batch recalculation of all metrics for this experiment. Returns 201 with the new pending recalculation, or 200 with the active one if a recalculation is already pending or in progress for this experiment. The response payload intentionally does not include the `results` array — at POST time the workflow has just been queued and no per-metric results exist yet. Clients should poll `GET metrics_recalculation/{id}/` for results as the workflow progresses.

Parameters

required

A unique integer value identifying this experiment.

required

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

Input

What triggered this recalculation (manual is the default for user-initiated runs) * `manual` - Manual * `cold_run` - Cold Run * `stale_refresh` - Stale Refresh * `auto_refresh` - Auto Refresh * `config_change` - Config Change * `experiment_launch` - Experiment Launch * `experiment_stop` - Experiment Stop * `experiment_update` - Experiment Update

Configure credentials above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import posthog from '@utdk/posthog';

await posthog.experimentsMetricsRecalculationCreate({
  "trigger": "manual"
})