---
title: "Update experiment status"
method: PATCH
path: "/experiments/{id}"
---

# Update experiment status

`PATCH /experiments/{id}`

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)**.

## Path parameters

- `id` integer, required

## Headers

- `api_key` string, required

## Request body

- object
  - `status` 1 | 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.

## Response `200`

Experiment updated

- object
  - `success` boolean
  - `experiment` Experiment
    - `id` integer
    - `project_id` integer
    - `name` string
    - `slug` string
    - `type` integer — Experiment type (1 = Quiz, 2 = Paywall)
    - `start_at` string, date-time, nullable
    - `end_at` string, date-time, nullable
    - `status` 1 | 2 | 3 | 4 | 5 | 6 | 7 — 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.
    - `filters` object[] — Array of filter objects
    - `variants` object[] — Array of variant objects
      - `model_id` integer — ID of the quiz or paywall model
      - `name` string — Variant name
      - `percent` integer — Percentage of users for this variant
    - `experiment_users_count` integer — Number of users in the experiment (only in show endpoint)
    - `created_at` string, date-time
    - `updated_at` string, date-time

## Other responses

- `404` — Experiment not found
- `422` — Validation error or invalid status transition

---

[API](https://skmtc.net/web2wave/apis/web2wave-api.md) · [All operations](https://skmtc.net/web2wave/apis/web2wave-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/web2wave/web2wave-api/versions/c88545119271/schema)
