Skip to main content

Serve Experiment Winner

POST/v2/project/{project_key}/experiment/{test_id}/serve-winner

Set 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

ParameterDescription
project_keyYour project's API key
test_idThe numeric experiment ID

Request body

FieldTypeRequiredDescription
variant_idstringYesWinning variant id (e.g. "1" for Variant 1). Same id as in Get Experiment Result variant rows. Alias: serving_variant_id.
traffic_allocationnumberNoRollout percentage 0100 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

FieldTypeDescription
serving_variant_idstringVariant now served at 100%
traffic_allocationnumberRollout % applied to eligible visitors
is_servingbooleanAlways 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.

Multi-day ramp-up

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

StatusMeaning
400Missing variant_id or invalid test_id
401Invalid or missing API key
404Experiment not found
409Experiment cannot serve (e.g. draft, already serving, or business rule violation)
Legacy deploy tests

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.

Next step

To stop forcing the winner variant, use Stop Experiment Serving.