Experiments-2
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
PATCH | |
DELETE | |
POST | |
POST | |
POST | |
POST | |
POST | |
POST | |
POST | |
POST |
Update experiments
Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers.
This mixin intercepts ApprovalRequired exceptions raised by the @approval_gate decorator on serializer methods and converts them into proper HTTP 409 Conflict responses with change request details.
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Request parameters
- namestring
- descriptionstring
- start_datestring
- end_datestring
- feature_flag_keystring
- holdout_idinteger
- parameters
- secondary_metrics
- saved_metrics_idsarray
- filters
- archivedboolean
- deletedboolean
- type
- exposure_criteria
- metrics
- metrics_secondary
- stats_config
- scheduling_config
- _create_in_folderstring
- conclusion
- conclusion_commentstring
- primary_metrics_ordered_uuids
- secondary_metrics_ordered_uuids
- exposure_preaggregation_enabledboolean
Response
Example request
PATCH /api /projects /:project_id /experiments /:idExample response
Status 200
Update experiments
Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers.
This mixin intercepts ApprovalRequired exceptions raised by the @approval_gate decorator on serializer methods and converts them into proper HTTP 409 Conflict responses with change request details.
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Request parameters
- namestring
- descriptionstring
- start_datestring
- end_datestring
- feature_flag_keystring
- holdout_idinteger
- parameters
- secondary_metrics
- saved_metrics_idsarray
- filters
- archivedboolean
- deletedboolean
- type
- exposure_criteria
- metrics
- metrics_secondary
- stats_config
- scheduling_config
- _create_in_folderstring
- conclusion
- conclusion_commentstring
- primary_metrics_ordered_uuids
- secondary_metrics_ordered_uuids
- exposure_preaggregation_enabledboolean
Response
Example request
PATCH /api /projects /:project_id /experiments /:idExample response
Status 200
Delete experiments
Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Example request
DELETE /api /projects /:project_id /experiments /:idExample response
Status 405 No response body
Delete experiments
Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Example request
DELETE /api /projects /:project_id /experiments /:idExample response
Status 405 No response body
Create experiments archive
Archive an ended experiment.
Hides the experiment from the default list view. The experiment can be restored at any time by updating archived=false. Returns 400 if the experiment is already archived or has not ended yet.
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Response
Example request
POST /api /projects /:project_id /experiments /:id /archiveExample response
Status 200
Create experiments archive
Archive an ended experiment.
Hides the experiment from the default list view. The experiment can be restored at any time by updating archived=false. Returns 400 if the experiment is already archived or has not ended yet.
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Response
Example request
POST /api /projects /:project_id /experiments /:id /archiveExample response
Status 200
Create experiments create exposure cohort for experiment
Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers.
This mixin intercepts ApprovalRequired exceptions raised by the @approval_gate decorator on serializer methods and converts them into proper HTTP 409 Conflict responses with change request details.
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Request parameters
- namestring
- descriptionstring
- start_datestring
- end_datestring
- feature_flag_keystring
- holdout_idinteger
- parameters
- secondary_metrics
- saved_metrics_idsarray
- filters
- archivedboolean
- deletedboolean
- type
- exposure_criteria
- metrics
- metrics_secondary
- stats_config
- scheduling_config
- _create_in_folderstring
- conclusion
- conclusion_commentstring
- primary_metrics_ordered_uuids
- secondary_metrics_ordered_uuids
- exposure_preaggregation_enabledboolean
Example request
POST /api /projects /:project_id /experiments /:id /create_exposure_cohort_for_experimentExample response
Status 200 No response body
Create experiments create exposure cohort for experiment
Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers.
This mixin intercepts ApprovalRequired exceptions raised by the @approval_gate decorator on serializer methods and converts them into proper HTTP 409 Conflict responses with change request details.
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Request parameters
- namestring
- descriptionstring
- start_datestring
- end_datestring
- feature_flag_keystring
- holdout_idinteger
- parameters
- secondary_metrics
- saved_metrics_idsarray
- filters
- archivedboolean
- deletedboolean
- type
- exposure_criteria
- metrics
- metrics_secondary
- stats_config
- scheduling_config
- _create_in_folderstring
- conclusion
- conclusion_commentstring
- primary_metrics_ordered_uuids
- secondary_metrics_ordered_uuids
- exposure_preaggregation_enabledboolean
Example request
POST /api /projects /:project_id /experiments /:id /create_exposure_cohort_for_experimentExample response
Status 200 No response body
Create experiments duplicate
Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers.
This mixin intercepts ApprovalRequired exceptions raised by the @approval_gate decorator on serializer methods and converts them into proper HTTP 409 Conflict responses with change request details.
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Request parameters
- namestring
- descriptionstring
- start_datestring
- end_datestring
- feature_flag_keystring
- holdout_idinteger
- parameters
- secondary_metrics
- saved_metrics_idsarray
- filters
- archivedboolean
- deletedboolean
- type
- exposure_criteria
- metrics
- metrics_secondary
- stats_config
- scheduling_config
- _create_in_folderstring
- conclusion
- conclusion_commentstring
- primary_metrics_ordered_uuids
- secondary_metrics_ordered_uuids
- exposure_preaggregation_enabledboolean
Example request
POST /api /projects /:project_id /experiments /:id /duplicateExample response
Status 200 No response body
Create experiments duplicate
Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers.
This mixin intercepts ApprovalRequired exceptions raised by the @approval_gate decorator on serializer methods and converts them into proper HTTP 409 Conflict responses with change request details.
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Request parameters
- namestring
- descriptionstring
- start_datestring
- end_datestring
- feature_flag_keystring
- holdout_idinteger
- parameters
- secondary_metrics
- saved_metrics_idsarray
- filters
- archivedboolean
- deletedboolean
- type
- exposure_criteria
- metrics
- metrics_secondary
- stats_config
- scheduling_config
- _create_in_folderstring
- conclusion
- conclusion_commentstring
- primary_metrics_ordered_uuids
- secondary_metrics_ordered_uuids
- exposure_preaggregation_enabledboolean
Example request
POST /api /projects /:project_id /experiments /:id /duplicateExample response
Status 200 No response body
Create experiments end
End a running experiment without shipping a variant.
Sets end_date to now and marks the experiment as stopped. The feature flag is NOT modified — users continue to see their assigned variants and exposure events ($feature_flag_called) continue to be recorded. However, only data up to end_date is included in experiment results.
Use this when:
- You want to freeze the results window without changing which variant users see.
- A variant was already shipped manually via the feature flag UI and the experiment just needs to be marked complete.
The end_date can be adjusted after ending via PATCH if it needs to be backdated (e.g. to match when the flag was actually paused).
Other options:
- Use ship_variant to end the experiment AND roll out a single variant to 100%% of users.
- Use pause to deactivate the flag without ending the experiment (stops variant assignment but does not freeze results).
Returns 400 if the experiment is not running.
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Request parameters
- conclusion
- conclusion_commentstring
Response
Example request
POST /api /projects /:project_id /experiments /:id /endExample response
Status 200
Create experiments end
End a running experiment without shipping a variant.
Sets end_date to now and marks the experiment as stopped. The feature flag is NOT modified — users continue to see their assigned variants and exposure events ($feature_flag_called) continue to be recorded. However, only data up to end_date is included in experiment results.
Use this when:
- You want to freeze the results window without changing which variant users see.
- A variant was already shipped manually via the feature flag UI and the experiment just needs to be marked complete.
The end_date can be adjusted after ending via PATCH if it needs to be backdated (e.g. to match when the flag was actually paused).
Other options:
- Use ship_variant to end the experiment AND roll out a single variant to 100%% of users.
- Use pause to deactivate the flag without ending the experiment (stops variant assignment but does not freeze results).
Returns 400 if the experiment is not running.
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Request parameters
- conclusion
- conclusion_commentstring
Response
Example request
POST /api /projects /:project_id /experiments /:id /endExample response
Status 200
Create experiments launch
Launch a draft experiment.
Validates the experiment is in draft state, activates its linked feature flag, sets start_date to the current server time, and transitions the experiment to running. Returns 400 if the experiment has already been launched or if the feature flag configuration is invalid (e.g. missing "control" variant or fewer than 2 variants).
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Response
Example request
POST /api /projects /:project_id /experiments /:id /launchExample response
Status 200
Create experiments launch
Launch a draft experiment.
Validates the experiment is in draft state, activates its linked feature flag, sets start_date to the current server time, and transitions the experiment to running. Returns 400 if the experiment has already been launched or if the feature flag configuration is invalid (e.g. missing "control" variant or fewer than 2 variants).
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Response
Example request
POST /api /projects /:project_id /experiments /:id /launchExample response
Status 200
Create experiments pause
Pause a running experiment.
Deactivates the linked feature flag so it is no longer returned by the /decide endpoint. Users fall back to the application default (typically the control experience), and no new exposure events are recorded (i.e. $feature_flag_called is not fired). Returns 400 if the experiment is not running or is already paused.
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Response
Example request
POST /api /projects /:project_id /experiments /:id /pauseExample response
Status 200
Create experiments pause
Pause a running experiment.
Deactivates the linked feature flag so it is no longer returned by the /decide endpoint. Users fall back to the application default (typically the control experience), and no new exposure events are recorded (i.e. $feature_flag_called is not fired). Returns 400 if the experiment is not running or is already paused.
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Response
Example request
POST /api /projects /:project_id /experiments /:id /pauseExample response
Status 200
Create experiments recalculate timeseries
Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers.
This mixin intercepts ApprovalRequired exceptions raised by the @approval_gate decorator on serializer methods and converts them into proper HTTP 409 Conflict responses with change request details.
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Request parameters
- namestring
- descriptionstring
- start_datestring
- end_datestring
- feature_flag_keystring
- holdout_idinteger
- parameters
- secondary_metrics
- saved_metrics_idsarray
- filters
- archivedboolean
- deletedboolean
- type
- exposure_criteria
- metrics
- metrics_secondary
- stats_config
- scheduling_config
- _create_in_folderstring
- conclusion
- conclusion_commentstring
- primary_metrics_ordered_uuids
- secondary_metrics_ordered_uuids
- exposure_preaggregation_enabledboolean
Example request
POST /api /projects /:project_id /experiments /:id /recalculate_timeseriesExample response
Status 200 No response body
Create experiments recalculate timeseries
Mixin for ViewSets to handle ApprovalRequired exceptions from decorated serializers.
This mixin intercepts ApprovalRequired exceptions raised by the @approval_gate decorator on serializer methods and converts them into proper HTTP 409 Conflict responses with change request details.
Required API key scopes
experiment:writePath parameters
- idinteger
- project_idstring
Request parameters
- namestring
- descriptionstring
- start_datestring
- end_datestring
- feature_flag_keystring
- holdout_idinteger
- parameters
- secondary_metrics
- saved_metrics_idsarray
- filters
- archivedboolean
- deletedboolean
- type
- exposure_criteria
- metrics
- metrics_secondary
- stats_config
- scheduling_config
- _create_in_folderstring
- conclusion
- conclusion_commentstring
- primary_metrics_ordered_uuids
- secondary_metrics_ordered_uuids
- exposure_preaggregation_enabledboolean
Example request
POST /api /projects /:project_id /experiments /:id /recalculate_timeseriesExample response
Status 200 No response body
Create experiments reset
Reset an experiment back to draft state.
Clears start/end dates, conclusion, and archived flag. 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
- project_idstring
Response
Example request
POST /api /projects /:project_id /experiments /:id /resetExample response
Status 200
Create experiments reset
Reset an experiment back to draft state.
Clears start/end dates, conclusion, and archived flag. 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
- project_idstring
Response
Example request
POST /api /projects /:project_id /experiments /:id /reset