Skip to main content

Link Hypothesis to Experiment

POST/v2/project/{project_key}/experiment/{test_id}/hypothesis

Attach a hypothesis to an existing experiment, so its result reads against what it was meant to prove. Send hypothesis_id 0 to detach.

An experiment holds one hypothesis. Attaching a second one replaces the first, it does not add to it. One hypothesis can be attached to many experiments, which is how a single idea tested three different ways stays recognisable as one idea.

Path parameters

ParameterTypeDescription
test_idintegerThe experiment ID

Body parameters

ParameterTypeRequiredDescription
hypothesis_idintegeryesThe hypothesis to attach. Send 0 or null to detach whatever is attached now

Example

curl -X POST "https://api-{region}.mida.so/v2/project/YOUR_PROJECT_KEY/experiment/34707/hypothesis" \
-H "Authorization: Bearer YOUR_GENERATED_API_KEY" \
-H "Content-Type: application/json" \
-d '{"hypothesis_id": 4021}'

Detach:

curl -X POST "https://api-{region}.mida.so/v2/project/YOUR_PROJECT_KEY/experiment/34707/hypothesis" \
-H "Authorization: Bearer YOUR_GENERATED_API_KEY" \
-H "Content-Type: application/json" \
-d '{"hypothesis_id": 0}'

Success response

{
"success": true,
"test_id": 34707,
"test_name": "Pricing page mobile plan card",
"hypothesis_id": 4021,
"linked": true
}

Response fields

FieldTypeDescription
hypothesis_idinteger|nullWhat is attached now. null after a detach
linkedbooleanfalse after a detach

Error responses

StatusMeaning
400test_id is missing or not valid
401Invalid or missing API key
404The experiment or the hypothesis does not exist in this project
400The hypothesis is archived. Restore it before attaching it to a test
For a new experiment, do it in one call

Create Experiment takes a hypothesis object or a hypothesis_id directly. Use this endpoint for experiments that already exist.