Change an experiment's status
POST/projects/:project/experiments/:experiment/change-status
Starts, pauses, resumes, stops or archives a test, after the same checks the dashboard's own buttons make. One call takes all five, named in action.
The action is named rather than the status assigned, because start and resume both end in running and are not the same thing. Starting freezes the test's metric definitions, copies the project's guardrails onto it and sets the day it started. Resuming does none of that.
Nothing here takes a test back to draft. Once visitors have been counted against a shape, un-starting it would leave a report nobody can read. To cancel a scheduled test, clear scheduled_start_at with Update an experiment instead.
Needs a publisher key.
Request
Responses
- 200
- 401
- 403
- 404
- 409
- 422
- 429
The test, in its new status.
The key is missing, wrong, revoked or expired.
The key is not a publisher (forbidden): building a test and putting it in front of visitors are two different jobs, as in the dashboard. Also returned when the plan has no API access, or the account cannot make changes right now.
Nothing at this address, or it belongs to a project the key cannot reach.
The action cannot be done from the test's current state, with code: invalid_state and a message naming the state it needs: "Only a running test can be paused.", "A running or paused test cannot be archived. Stop it first.", and so on. The plan's running limit and a plan that does not include the test's kind refuse the same way.
start has one more case of its own. A draft that is not ready comes back with code: not_ready, message set to the first thing in the way, and checks listing every line that was checked, so you can fix them all at once.
action is missing, or is not one of the five.
Too many calls. Wait for the number of seconds in Retry-After.
Response Headers
Seconds to wait before calling again.