Skip to main content

Update Experiment

PATCH/v2/project/{project_key}/experiment/{test_id}

Update an experiment's name, URL, configuration, or targeting. Only fields you include are changed — all other fields remain unchanged.

Path parameters

ParameterDescription
project_keyYour project's API key
test_idThe numeric experiment ID

Updatable fields

FieldTypeDescription
test_namestringNew display name for the experiment
urlstringChange the test page URL
configurationobjectUpdate traffic or confidence settings (see below)
targetingobjectUpdate device/browser/country targeting (see below)
tagsarrayExperiment tags for organization

Configuration fields

FieldTypeDescription
traffic_allocationintegerPercentage of visitors included in the test. 0100.
confidence_intervalintegerStatistical confidence threshold. Typically 95.

Targeting fields

FieldTypeDescription
devicesarrayLimit to devices: "desktop", "mobile", "tablet". Empty = all devices.
browsersarrayLimit to browsers: "chrome", "firefox", "safari", "edge". Empty = all.
countriesarrayISO 3166-1 alpha-2 country codes to include. Empty = all countries.

Example: reduce traffic allocation

curl -X PATCH "https://api-{region}.mida.so/v2/project/YOUR_PROJECT_KEY/experiment/1234" \
-H "Authorization: Bearer YOUR_GENERATED_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"configuration": {
"traffic_allocation": 50
}
}'

Example: target desktop visitors only

curl -X PATCH "https://api-{region}.mida.so/v2/project/YOUR_PROJECT_KEY/experiment/1234" \
-H "Authorization: Bearer YOUR_GENERATED_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"targeting": {
"devices": ["desktop"]
}
}'

Success response

{
"success": true,
"test_id": 1234
}

Error responses

StatusMeaning
400Invalid field values or malformed request body
401Invalid or missing API key
404Experiment not found or belongs to a different project
Variants cannot be updated via this endpoint

Variant CSS, JS, and visual editor mutations (data) cannot be modified after creation via the API. To change variant content, delete the experiment and recreate it with the updated variants, or use the Mida dashboard's visual editor. This endpoint is for metadata and configuration changes only.

Next step

To start, pause, or end the experiment, use Update Experiment Status.