Experiment

Applies a lifecycle transition to an experiment and returns the full updated document.

Valid transitions: draft/paused → active, active → paused, active/paused → completed; anything else is 409 with code invalid_transition. Activation additionally guards against flag keys owned by another running experiment (flag_key_in_use), an already-elapsed end date (invalid_window), and sticky enrollment without a leavable user predicate (invalid_enrollment_mode).

post/campaign/experiments/{experimentId}/state

Path parameters

experimentIdstring required

The experiment id.

Request body

action'activate' | 'pause' | 'complete' required

Response

OK

idstring required

The unique id of the experiment document.

namestring required

Human-readable name.

descriptionstring required

Human-readable description of the hypothesis.

state'draft' | 'active' | 'paused' | 'completed' required
scope'global' | 'attached' required
userEnrollment'perSession' | 'sticky' required
startAtstring date-time nullable

Outside the [startAt, endAt) window the experiment is treated as inactive.

endAtstring date-time nullable

End of the experiment window; the experiment auto-completes afterwards.

createdBystring required

The email of the admin who created the experiment.

createdAtstring date-time required

When the experiment was created.

updatedAtstring date-time required

When the experiment was last changed.

Changes

No recorded changes to this endpoint across all 14 revisions of this API.