Serve Experiment Winner
/v2/project/{project_key}/experiment/{test_id}/serve-winnerSet winner and serve the winning variant at 100% on the same experiment — the API equivalent of the dashboard Set winner & serve. Does not create a separate deploy test.
Path parameters
| Parameter | Description |
|---|---|
project_key | Your project's API key |
test_id | The numeric experiment ID |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
variant_id | string | Yes | Winning variant id (e.g. "1" for Variant 1). Same id as in Get Experiment Result variant rows. Alias: serving_variant_id. |
traffic_allocation | number | No | Rollout percentage 0–100 of eligible visitors who receive the winner (deterministic bucketing). Omit to keep the experiment's existing traffic_allocation. |
Example
curl -X POST "https://api-{region}.mida.so/v2/project/YOUR_PROJECT_KEY/experiment/1234/serve-winner" \
-H "Authorization: Bearer YOUR_GENERATED_API_KEY" \
-H "Content-Type: application/json" \
-d '{"variant_id": "1", "traffic_allocation": 25}'
Success response
{
"success": true,
"test_id": 1234,
"serving_variant_id": "1",
"traffic_allocation": 25,
"is_serving": true,
"message": "Winner is now served to eligible traffic at the configured rollout percentage on the same experiment."
}
Response fields
| Field | Type | Description |
|---|---|---|
serving_variant_id | string | Variant now served at 100% |
traffic_allocation | number | Rollout % applied to eligible visitors |
is_serving | boolean | Always true on success |
After serving, conversions are tagged in the goal table with is_serving=1. Use report_phase=post_deploy on Get Experiment Result, Get Experiment Timeseries, and Get Experiment Metrics to read post-deploy stats.
To change rollout after serve without re-picking the winner, use Update Serving Rollout.
Scheduled ramp-up over several days (automatic daily increases) is not available via API yet. Use a fixed traffic_allocation and call Update Serving Rollout when you want to increase exposure manually.
Error responses
| Status | Meaning |
|---|---|
400 | Missing variant_id or invalid test_id |
401 | Invalid or missing API key |
404 | Experiment not found |
409 | Experiment cannot serve (e.g. draft, already serving, or business rule violation) |
Older Mida accounts may still have separate is_deploy=1 deploy campaigns. This endpoint updates the same A/B test row via serving_variant_id. Legacy deploy flows are unchanged and are not created by this endpoint.
To stop forcing the winner variant, use Stop Experiment Serving.