Skip to main content

Get Experiment Preview URLs

GET/v2/project/{project_key}/experiment/{test_id}/preview-urls

Return ready-to-share preview links for every variant of an experiment — Control plus all treatments. Each link forces the requested variant to render regardless of the visitor's normal bucketing or any active segment rules. Useful for QA, customer-support flows, or stakeholder review before launch.

Path parameters

ParameterTypeDescription
project_keystringYour project key (the key= value in the Mida script tag).
test_idintegerNumeric experiment ID. Get this from List Experiments.

Example

curl "https://api-{region}.mida.so/v2/project/YOUR_PROJECT_KEY/experiment/1234/preview-urls" \
-H "Authorization: Bearer YOUR_GENERATED_API_KEY"

Success response

{
"success": true,
"test_id": 1234,
"test_name": "Homepage CTA Button Color Test",
"page_url": "https://example.com/",
"variants": [
{
"variant_id": 0,
"name": "Control",
"preview_url": "https://example.com/?test-preview=1234&test-variant=Control"
},
{
"variant_id": 1,
"name": "Variant 1",
"preview_url": "https://example.com/?test-preview=1234&test-variant=Variant_1"
}
]
}

Response fields

FieldTypeDescription
test_idintegerThe experiment's ID
test_namestringExperiment display name
page_urlstringThe page URL the experiment runs on (taken from test.url, falling back to the first key in test.data)
variantsarrayOne entry per variant — Control first, treatments after
variants[].variant_idinteger0 for Control, 1+ for treatments
variants[].namestringVariant name (e.g. Control, Variant 1)
variants[].preview_urlstringFull URL — open it in any browser to render that specific variant

How the preview URL works

Each link appends two query parameters to the experiment's page URL:

ParameterValue
test-previewThe numeric test_id
test-variantThe variant name with spaces replaced by _ (e.g. Variant AVariant_A)

When the Mida script loads on a page with these parameters, it bypasses normal traffic allocation, segment rules, and country/device targeting — and renders the requested variant directly. Control is rendered through the experiment's control_attr (it isn't stored as a row in test.data, but it's always available as variant_id=0).

Error responses

StatusMeaning
400test_id missing or non-numeric
401Invalid or missing API key
403Project is inactive
404Experiment not found in this project (or already deleted)
409Experiment has no page URL configured — cannot build a preview link. Set url via Update Experiment.
Next step

Send the Control + Variant URLs to your customer or QA team. They'll see the exact rendering Mida produces in the live experiment, without having to be in the test's traffic bucket.