Experiments
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
POST | |
POST | |
GET |
Create experiments session contexts
Resolve experiment context for a batch of session recordings.
Batch variant of session_context, used to prefetch the replay player's experiments
box for a whole recordings list in one request. POST because the id list doesn't fit a
query string; the endpoint only reads. Already-computed sessions are served from (and
cold ones written to) the same short-lived per-viewer cache the single-session endpoint
uses, so opening any prefetched recording renders its context instantly. Sessions whose
recording metadata doesn't exist yet are omitted from the response, as are recordings
the caller can't access and sessions beyond the batch's recording-day budget (each
distinct recording day costs its own set of ClickHouse scans, so only the most recent
days are computed per request).
Required API key scopes
experiment:readsession_recording:readRequest parameters
- session_idsarray
Response
Example request
POST /api /projects /:project_id /experiments /session_contextsExample response
Status 200
Create experiments setup context
Facts about this project that decide how to configure a new experiment.
Returns the team's experiment defaults, which SDKs call feature flags, traffic on a target surface, the baseline of a candidate metric, how recent experiments were set up, and the most reused shared metrics. Each section has its own status, so a slow or failed read leaves the others valid. POST because the inputs describe a plan rather than a resource; the endpoint only reads.
Required API key scopes
experiment:readexperiment_saved_metric:readquery:readRequest parameters
- target_eventstring | null
- target_url_containsstring | null
- target_properties
- metric_eventstring | null
- metric_properties
- previous_experiments_limitintegerDefault:
10 - shared_metrics_limitintegerDefault:
10
Response
Example request
POST /api /projects /:project_id /experiments /setup_contextExample response
Status 200
Retrieve experiments stats
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.
Required API key scopes
experiment:readExample request
GET /api /projects /:project_id /experiments /stats




