Experiments
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
POST | |
POST | |
POST | |
POST | |
POST | |
POST | |
GET | |
POST | |
POST | |
POST | |
POST | |
GET | |
GET | |
POST | |
GET |
Create experiments recalculate timeseries
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:writePath parameters
- idinteger
Request parameters
- namestring
- descriptionstringnull
- start_datestringnull
- end_datestringnull
- feature_flag_keystring
- holdout_idintegernull
- parameters
- running_time_calculation
- excluded_variantsarraynull
- secondary_metrics
- saved_metrics_idsarraynull
- filters
- archivedbooleanDefault:
false - deletedbooleannull
- type
- exposure_criteria
- metrics
- metrics_secondary
- stats_config
- scheduling_config
- allow_unknown_eventsbooleanDefault:
false - _create_in_folderstring
- conclusion
- conclusion_commentstringnull
- repositorystringnull
- primary_metrics_ordered_uuids
- secondary_metrics_ordered_uuids
- only_count_matured_usersboolean
- update_feature_flag_paramsbooleanDefault:
false - versionintegernull
- original_experimentobjectnull
Example request
POST /api/projects/:project_id/experiments/:id/recalculate_timeseries Example response
Status 200 No response body
Create experiments reset
Reset an experiment back to draft state.
Clears start/end dates, conclusion, archived flag, and any flag-cleanup task pointer. The feature flag is left unchanged — users continue to see their assigned variants.
Previously collected events still exist but won't be included in results unless the start date is manually adjusted after re-launch.
Returns 400 if the experiment is already in draft state.
Required API key scopes
experiment:writePath parameters
- idinteger
Response
Example request
POST /api/projects/:project_id/experiments/:id/reset Example response
Status 200
Create experiments resume
Resume a paused experiment.
Reactivates the linked feature flag so it is returned by /decide again. Users are re-bucketed deterministically into the same variants they had before the pause, and exposure tracking resumes. Returns 400 if the experiment is not running or is not paused.
Required API key scopes
experiment:writePath parameters
- idinteger
Response
Example request
POST /api/projects/:project_id/experiments/:id/resume Example response
Status 200
Create experiments session buckets
Session recordings of this experiment matching a bucket.
Answers the questions a recordings query can't express on its own — "fired any of these metrics", "fired none of them", "was exposed but never completed the funnel in this session" — by returning a bounded, most-recent-first list of session IDs to pass back as a recordings query's session_ids. POST because the metric list doesn't fit a query string; the endpoint only reads.
Session-scoped and goal-free: the set describes what happened in each session, while the experiment analysis counts per person over the whole run window. A session can be in the drop-off bucket while the same person converts in a later one.
Required API key scopes
experiment:readsession_recording:readPath parameters
- idinteger
Request parameters
- bucket
- metric_uuidsarray
- variantstringnull
- limitintegerDefault:
100
Response
Example request
POST /api/projects/:project_id/experiments/:id/session_buckets Example response
Status 200
Create experiments session event deltas
The recordings worth watching for this experiment, grouped into cards.
Each card is one sentence and the recordings that back it: an event one variant did clearly more than the others, an error signal concentrated in one variant, or a shortcut to a metric event happening on screen. Every card's count is a count of recordings that actually exist, so handing its session ids to the recordings list can't come back empty. POST to take the same throttle and cache posture as the other reads in this family rather than because it carries a body: it takes no parameters, and it only reads.
It reports no effect size. Cards carry a direction and a band rather than a rate, a ratio or a person count: the experiment's results already state magnitudes, computed per person over the whole run window, and this reads one session per person over a clamped one. Two numbers for the same event would read as a contradiction, so this surface states none. That is what lets a card sit on one of the experiment's own metric events, which it names, so a reader is sent to the results rather than given a second answer.
Required API key scopes
experiment:readsession_recording:readPath parameters
- idinteger
Response
Example request
POST /api/projects/:project_id/experiments/:id/session_event_deltas Example response
Status 200
Create experiments ship variant
Ship a variant and (optionally) end the experiment.
Updates the feature flag so the selected variant gets 100% of the variant
distribution. By default, existing release conditions on the flag are preserved
untouched — the variant is served only to users who already match them. Pass
release_to_everyone: true to also prepend a catch-all release condition
that rolls the variant out to 100% of users (overrides any existing release
conditions on the flag).
Can be called on both running and stopped experiments. If the experiment is still running, it will also be ended (end_date set and status marked as stopped). If the experiment has already ended, only the flag is rewritten - this supports the "end first, ship later" workflow.
If an approval policy requires review before changes on the flag take effect, the API returns 409 with a change_request_id. The experiment is NOT ended until the change request is approved and the user retries.
Returns 400 if the experiment is in draft state, the variant_key is not found on the flag, or the experiment has no linked feature flag.
Required API key scopes
experiment:writePath parameters
- idinteger
Request parameters
- conclusion
- conclusion_commentstringnull
- open_cleanup_prbooleanDefault:
false - repositorystringnull
- set_repository_as_team_defaultbooleanDefault:
false - variant_keystring
- release_to_everyonebooleanDefault:
false
Response
Example request
POST /api/projects/:project_id/experiments/:id/ship_variant Example response
Status 200
Retrieve experiments timeseries results
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:readPath parameters
- idinteger
Query parameters
- fingerprintstring
- metric_uuidstring
Example request
GET /api/projects/:project_id/experiments/:id/timeseries_results Example response
Status 200 No response body
Create experiments unarchive
Unarchive an archived experiment.
Restores the experiment to the default list view. Returns 400 if the experiment is not currently archived.
Required API key scopes
experiment:writePath parameters
- idinteger
Response
Example request
POST /api/projects/:project_id/experiments/:id/unarchive Example response
Status 200
Create experiments unfreeze exposure
Reopen enrollment on an exposure-frozen experiment.
Removes the snapshot-cohort condition and freeze markers from every release group, restoring the flag's original targeting: new users can enroll again and already-enrolled users keep their assigned variant. The snapshot cohort is soft-deleted. The serialized status returns to 'running'.
Returns 400 if the experiment is not running or its exposure is not frozen.
Required API key scopes
experiment:writePath parameters
- idinteger
Response
Example request
POST /api/projects/:project_id/experiments/:id/unfreeze_exposure