Experiments
Create, weight, pause, and measure A/B experiments — with a built-in two-proportion significance test.
Admin surface for A/B experiments: CRUD plus a results endpoint that joins exposures against your analytics events and runs a two-proportion z-test of each variant against the control. The client-side assignment + exposure calls feed these results. See the Experiments guide for the flow.
All endpoints are project-scoped and require a developer PAT (Authorization: Bearer).
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /admin/projects/:projectId/experiments | Create an experiment. |
| GET | /admin/projects/:projectId/experiments | List all experiments. |
| GET | /admin/projects/:projectId/experiments/:key | Fetch one experiment by key. |
| PATCH | /admin/projects/:projectId/experiments/:key | Update name / description / variants / status. |
| DELETE | /admin/projects/:projectId/experiments/:key | Delete an experiment. |
| GET | /admin/projects/:projectId/experiments/:key/results | Per-variant counts, conversion rate, z-test. |
Experiments are addressed by key (the stable, customer-facing identifier), not by their internal id.
POST /admin/projects/:projectId/experiments
Request
| Field | Type | Required | Description |
|---|---|---|---|
key | string | yes | Unique experiment key. |
name | string | yes | Human-readable name. |
description | string | no | Optional description. |
variants | array | yes | ≥2 entries of { key, weight }. The first variant is the control. Keys unique; weight a positive integer (1–1,000,000). |
status | string | no | "active" (default), "paused", or "ended". |
Weights are relative — [{ "key": "a", "weight": 1 }, { "key": "b", "weight": 3 }]
is a 25/75 split. They don't have to sum to 100.
Response 201
The created experiment row (including id, variants, status, timestamps).
Errors
400 INVALID_KEY/INVALID_NAME— missing or empty.400 INVALID_VARIANTS— fewer than 2 variants, a non-object entry, an empty/duplicate key, or a non-positive / out-of-range weight.error.messagesays which.400 INVALID_STATUS— status not one ofactive|paused|ended.409 KEY_TAKEN— an experiment with that key already exists.500 CREATE_FAILED.
PATCH /admin/projects/:projectId/experiments/:key
Update any of name, description, variants, status. Re-weighting via variants
never re-rolls already-assigned users — assignments are persisted; the new weights
only affect users bucketed after the edit. Set status to "paused" to stop new
assignments while still serving existing ones, or "ended" to wind the experiment down.
Errors
400 INVALID_NAME/INVALID_VARIANTS/INVALID_STATUS— same rules as create.404 NOT_FOUND— no experiment with that key.500 UPDATE_FAILED.
GET /admin/projects/:projectId/experiments/:key/results
Per-variant analytics with a significance test against the control.
Query
| Param | Type | Description |
|---|---|---|
conversion_event | string | Optional. The analytics event name that counts as a conversion. Omit to get assigned/exposed counts only (conversions are 0 across the board). |
For each variant the response carries:
assigned_count— distinct users assigned to the variant.exposed_count— distinct users with ≥1 exposure for the variant.converted_count— distinct exposed users who emittedconversion_eventat or after their assignment time.conversion_rate—converted_count / exposed_count.is_control—truefor the first variant.z_score/p_value— two-proportion z-test of this variant vs. the control (two-sided).nullfor the control itself, andnullwhen either sample is empty or the pooled variance is degenerate.
Response 200
Errors
400 INVALID_CONVERSION_EVENT—conversion_eventpresent but empty.404 NOT_FOUND— no experiment with that key.500 RESULTS_FAILED.
MCP tools
| Tool | Description |
|---|---|
amba_experiments_create | Create an experiment with weighted variants. |
amba_experiments_list | List all experiments. |
amba_experiments_get | Fetch one experiment by key. |
amba_experiments_update | Update name / description / variants / status. |
amba_experiments_delete | Delete an experiment. |
amba_experiments_results | Per-variant counts, conversion rate, and significance. |