experiments

Mixin for ViewSets to handle approval-gate exceptions raised from decorated serializers.

Intercepts ApprovalRequired (409) and PolicyConflict (400) raised by the @approval_gate decorator on serializer methods and converts them into the same responses the viewset path produces (see decorators._result_to_response), so both paths share one contract.

get/api/projects/{project_id}/experiments/{id}/metrics_recalculation/latest/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/experiments/{id}/metrics_recalculation/latest/
  • Auth: HTTP bearer

Path parameters

idinteger required

A unique integer value identifying this experiment.

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/.

Response

idstring uuid required

Unique identifier for this recalculation job

experiment_idinteger required

ID of the experiment being recalculated

status'pending' | 'in_progress' | 'completed' | 'failed' required
  • pending - Pending
  • in_progress - In Progress
  • completed - Completed
  • failed - Failed
total_metricsinteger required

Total number of metrics to recalculate

completed_metricsinteger required

Number of metrics with a COMPLETED result row in this run (derived, not stored)

failed_metricsinteger required

Number of failed metrics in this run (derived): FAILED result rows plus discovery-step failures that never made it to a result row

metric_errorsunknown required
created_atstring date-time required

When the job was created

started_atstring date-time nullable required

When processing started

completed_atstring date-time nullable required

When processing completed

query_tostring date-time nullable required

Upper time bound the metrics in this run were calculated against (the data freshness cutoff). Shared by every metric in the run; null until processing starts

metric_retriesunknown required
rows_readinteger nullable

Rows read by the run's metric queries so far, both finished and currently running. Cumulative and roughly monotonic across the run; the primary live progress signal

estimated_rows_totalinteger nullable

ClickHouse's total_rows_approx across running queries plus the final read_rows of finished ones. A soft ceiling revised mid-scan, so it can exceed or trail rows_read; treat rows_read as the reliable signal

result_source'recalculation' | 'timeseries_fallback' required
  • recalculation - recalculation
  • timeseries_fallback - timeseries_fallback

Changes

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