v1

latestOpenAPI 3.0.32026-07-248519153.1 KB

Update experiment status

Change the lifecycle status of an experiment. This is the single way to pause, stop, reactivate, archive, or mark success/fail via the API.

Side effects (same as cabinet):

  • Transition to Active (2) sets start_at if empty and clears a stale past end_at.
  • Transition to Success, Fail, Stop, or Archive (4–7) sets end_at if empty.

Cannot revert a non-draft experiment back to Draft (1).

patch/experiments/{id}

Path parameters

idinteger required

Headers

api_keystring required

Request body

status1 | 2 | 3 | 4 | 5 | 6 | 7 required

Lifecycle status of an A/B experiment:

  • 1 — Draft — Created but not serving traffic. No new users enrolled.
  • 2 — Active — Running. New users are enrolled and variants are served. Sets start_at on first activation; clears a stale past end_at on reactivation.
  • 3 — Pause — Temporarily halted. No new users enrolled; existing assignments are kept.
  • 4 — Success — Marked as a winning test. Sets end_at when missing. No new users enrolled.
  • 5 — Fail — Marked as a losing test. Sets end_at when missing. No new users enrolled.
  • 6 — Stop — Stopped (no new users). Sets end_at when missing. Differs from Archive — experiment stays in the main list.
  • 7 — Archive — Stopped and archived (cabinet "Stop and move to archive"). Sets end_at when missing.

Example request

{
  "status": 2
}

Response

Experiment updated

successboolean

Example response

{
  "success": true,
  "experiment": {
    "id": 1,
    "project_id": 78,
    "name": "Quiz A/B Test",
    "slug": "quiz-ab-test",
    "type": 1,
    "start_at": "2024-01-15T10:00:00Z",
    "end_at": "2024-02-15T10:00:00Z",
    "status": 2,
    "variants": [
      {
        "model_id": 123,
        "name": "Variant A",
        "percent": 50
      }
    ],
    "experiment_users_count": 150,
    "created_at": "2024-01-15T10:00:00Z",
    "updated_at": "2024-01-15T10:00:00Z"
  }
}