v1

latestOpenAPI 3.0.32026-07-248519153.1 KB

Create experiment

Create a new A/B experiment in the project resolved from the API key. Defaults to draft status; pass status: 2 to create as active. Variant percent values should sum to 100.

post/experiments

Request body

namestring required
slugstring required
type1 | 2 required

1 = Quiz, 2 = Paywall

status1 | 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.
allow_intersectionboolean
start_atstring date-time

Defaults to now when omitted

end_atstring date-time nullable
tagsstring[]

Example request

{
  "name": "Homepage quiz test",
  "slug": "homepage-quiz-test",
  "status": 2
}

Response

Experiment created

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"
  }
}