{
  "openapi": "3.1.0",
  "info": {
    "title": "Mida API",
    "version": "2.0.0",
    "description": "Manage Mida A/B tests, goals, events, hypotheses, surveys and personalization campaigns. Accounts live in one region: call the US or EU server your account is hosted in (Dashboard → Settings shows which). Generated from https://docs.mida.so.",
    "contact": {
      "name": "Mida",
      "url": "https://www.mida.so"
    }
  },
  "externalDocs": {
    "url": "https://docs.mida.so/docs/intro"
  },
  "servers": [
    {
      "url": "https://api-us.mida.so",
      "description": "US region"
    },
    {
      "url": "https://api-eu.mida.so",
      "description": "EU region"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "apiKeyHeader": []
    }
  ],
  "tags": [
    {
      "name": "Experiments"
    },
    {
      "name": "Goals"
    },
    {
      "name": "Events"
    },
    {
      "name": "Hypotheses"
    },
    {
      "name": "Personalization"
    },
    {
      "name": "Exclusion groups"
    },
    {
      "name": "Surveys"
    },
    {
      "name": "Account"
    },
    {
      "name": "Projects"
    }
  ],
  "paths": {
    "/v2/project/{project_key}/experiment/{test_id}/discussion": {
      "post": {
        "operationId": "addExperimentComment",
        "summary": "Add Experiment Comment",
        "description": "Post a comment to the Discussion on an experiment's report. The test's assigned members are notified by email, exactly as for a comment made in the dashboard. Requires a signed-in author (an MCP connection); plain API keys can read the thread but not post.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/add-experiment-comment"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The experiment id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "comment": {
                    "type": "string",
                    "description": "**Required.** Plain text, up to 5000 characters"
                  },
                  "source": {
                    "type": "string",
                    "description": "Optional provenance: `user` (default), `agent`, or `routine`. Non-`user` comments render with a \"via Mida Agent\" badge and the notification email is attributed to the Agent, never to the person. Honoured only for identity-carrying (MCP) connections"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "test_id": 34567,
                  "comment": "Calling this Friday unless mobile diverges.",
                  "note": "Posted to the Discussion on the report. Assigned members are being notified by email."
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "get": {
        "operationId": "getExperimentDiscussion",
        "summary": "Get Experiment Discussion",
        "description": "The Discussion thread on an experiment's report: every comment with its author, time, and whether it was edited. This is where teams record decisions and caveats next to the numbers.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-experiment-discussion"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The experiment id"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "test_id": 34567,
                  "test_name": "Pricing: Daily-cost framing on Growth plan",
                  "count": 2,
                  "comments": [
                    {
                      "comment_id": 981,
                      "comment": "Calling this Friday unless mobile diverges.",
                      "author_name": "Alicia",
                      "created_at": "2026-08-18T10:04:12.000Z",
                      "edited": false
                    },
                    {
                      "comment_id": 984,
                      "comment": "Mobile is flat so far — desktop carrying the lift.",
                      "author_name": "Ethan",
                      "created_at": "2026-08-19T02:41:55.000Z",
                      "edited": true,
                      "is_you": true
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/personalization/campaigns/{campaign_id}/accounts": {
      "post": {
        "operationId": "addPersonalizationAccounts",
        "summary": "Add Accounts to a Personalization Campaign",
        "description": "Add companies to a campaign that already exists and get each one's link back immediately. The link is final on return, so it is safe to store or send straight away; the researched copy lands behind that same URL over the following minutes.",
        "tags": [
          "Personalization"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/add-personalization-accounts"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "campaign_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The campaign to add to. From List Personalization Campaigns"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "accounts": {
                    "type": "array",
                    "items": {},
                    "description": "**Required.** Entries of `{ \"name\": string, \"domain\"?: string, \"notes\"?: string }`"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "abm_campaign_id": 23,
                  "campaign_name": "TechSpo 2026",
                  "url": "/personalize/abm/23",
                  "launched": true,
                  "links_live": true,
                  "added": [
                    {
                      "abm_campaign_account_id": 512,
                      "name": "Klaviyo",
                      "domain": "klaviyo.com",
                      "notes": "On VWO today, moving off it over price...",
                      "link": "https://yoursite.com/?m=k3Rt9vQ2mLpX7wZa1BcD"
                    }
                  ],
                  "already_on_campaign": [],
                  "pages": [
                    "https://yoursite.com/",
                    "https://yoursite.com/pricing"
                  ],
                  "building": true,
                  "needs_goal": false,
                  "_note": "The links work now and are final. Research and personalized copy are being written and take a few minutes per account; until then the link shows the page as it normally is. The campaign is live, so each link personalizes as soon as its copy lands."
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/event": {
      "post": {
        "operationId": "createEvent",
        "summary": "Create Event",
        "description": "Record a custom event for a specific visitor. The event is tied to a visitor record in Mida — identify the visitor using their Mida UUID, email, or your own user ID.",
        "tags": [
          "Events"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/create-event"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_name": {
                    "type": "string",
                    "description": "Name of the event (e.g. `purchase_completed`, `form_submitted`, `plan_upgraded`)"
                  },
                  "mida_uuid": {
                    "type": "string",
                    "description": "Mida-generated visitor UUID"
                  },
                  "email": {
                    "type": "string",
                    "description": "Visitor's email (requires prior `mida.identify({ email })` call)"
                  },
                  "id": {
                    "type": "string",
                    "description": "Your own user ID (requires prior `mida.identify({ id })` call)"
                  },
                  "properties": {
                    "type": "object",
                    "description": "Any additional metadata to attach to the event"
                  }
                },
                "required": [
                  "event_name"
                ]
              },
              "example": {
                "event_name": "purchase_completed",
                "mida_uuid": "YOUR_VISITOR_UUID",
                "properties": {
                  "amount": 199.99,
                  "plan": "pro"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "message": "Event recorded successfully"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/exclusion-groups": {
      "post": {
        "operationId": "createExclusionGroup",
        "summary": "Create Exclusion Group",
        "description": "Make a set of experiments mutually exclusive: each visitor is assigned to exactly one of them, by traffic split. Use this when experiments overlap on the same page or audience — the answer to overlap is a group, not fewer tests.",
        "tags": [
          "Exclusion groups"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/create-exclusion-group"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "**Required.** Label shown in the dashboard's Mutually Exclusive list"
                  },
                  "description": {
                    "type": "string",
                    "description": "Optional note on why these are grouped"
                  },
                  "tests": {
                    "type": "array",
                    "items": {},
                    "description": "**Required.** At least two entries of `{ \"test_id\": number, \"percent\"?: number }`. Every experiment must belong to this project. If any `percent` is given, all must be, and they must sum to 100. Omit all percents for an even split (3 tests → 33/33/34)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "name": "Pricing page tests",
                  "tests": [
                    {
                      "test_id": 34567,
                      "percent": 60
                    },
                    {
                      "test_id": 34580,
                      "percent": 40
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "get": {
        "operationId": "listExclusionGroups",
        "summary": "List Exclusion Groups",
        "description": "List the project's mutually exclusive groups. A group splits traffic so each visitor enters exactly one of its experiments, keeping tests that share a page from contaminating each other's results.",
        "tags": [
          "Exclusion groups"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/list-exclusion-groups"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "groups": [
                    {
                      "id": 42,
                      "name": "Pricing page tests",
                      "description": "Both tests change the Growth plan card",
                      "tests": [
                        {
                          "test_id": 34567,
                          "percent": 50,
                          "test_name": "Daily-cost framing",
                          "status": 1
                        },
                        {
                          "test_id": 34580,
                          "percent": 50,
                          "test_name": "Annual toggle default",
                          "status": 9
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/create-experiment": {
      "post": {
        "operationId": "createExperiment",
        "summary": "Create Experiment",
        "description": "Create a new A/B experiment for a project. The experiment is created in draft status by default.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/create-experiment"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "test_name": {
                    "type": "string",
                    "description": "**Required.** Display name for the experiment"
                  },
                  "url": {
                    "type": "string",
                    "description": "The **editor URL**: the single page the visual editor and every preview link open, e.g. `https://example.com/pricing`. Must be a specific page — a wildcard pattern returns `400`, because a pattern cannot be opened in a browser. Optional when `page_urls` is given, in which case the first entry is used"
                  },
                  "page_urls": {
                    "type": "array",
                    "items": {},
                    "description": "Optional. Where the experiment runs, when it is more than the one page in `url`. Entries are a plain page address or a `{ url, rule, allowed }` object — see below. At most 50"
                  },
                  "variants": {
                    "type": "array",
                    "items": {},
                    "description": "**Required.** One or more treatment variant objects — **do not include a \"Control\" entry** (see Variants section)"
                  },
                  "hypothesis": {
                    "type": "object",
                    "description": "A new hypothesis to create and attach. Needs at least one of `observation`, `problem` or `solution`. Ratings are 1 to 5. Full field list in Create Hypothesis"
                  },
                  "hypothesis_id": {
                    "type": "integer",
                    "description": "An existing hypothesis to attach instead"
                  },
                  "status": {
                    "type": "integer"
                  },
                  "primary_goal": {
                    "type": "object"
                  },
                  "configuration": {
                    "type": "object"
                  }
                },
                "required": [
                  "test_name",
                  "variants"
                ]
              },
              "example": {
                "test_name": "Homepage CTA Button Color Test",
                "status": 9,
                "url": "https://example.com/",
                "variants": [
                  {
                    "name": "Variant 1",
                    "nickname": "Red Button",
                    "customCSS": ".cta-button { background-color: #FF5733 !important; }",
                    "customJS": "",
                    "data": []
                  }
                ],
                "primary_goal": {
                  "goal_name": "CTA Button Click",
                  "goal_type": "clickOnElement",
                  "goal_value": ".cta-button"
                },
                "configuration": {
                  "traffic_allocation": 100,
                  "confidence_interval": 95
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "status": 9,
                  "test_id": 28222,
                  "company_id": 1001,
                  "goal_profile_id": 8936,
                  "secondary_goals_count": 0,
                  "saved_targeting": {
                    "runs_on": "pages matching https://example.com/",
                    "url_rule": [],
                    "data_keys": [
                      "https://example.com/"
                    ],
                    "targeting": {}
                  },
                  "warnings": []
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/goal": {
      "post": {
        "operationId": "createGoal",
        "summary": "Create Goal",
        "description": "Create a goal profile for the selected project. Goals define what counts as a conversion: page visits, clicks, forms, scroll depth, events, revenue, or manual triggers.",
        "tags": [
          "Goals"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/create-goal"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "goal_name": {
                    "type": "string",
                    "description": "Human-readable name for the goal (e.g., `\"Signup Form Submit\"`)"
                  },
                  "goal_type": {
                    "type": "string",
                    "description": "The type of conversion to track (see table below)"
                  },
                  "goal_value": {
                    "type": "string",
                    "description": "The selector, URL, text, or trigger value (depends on `goal_type`)"
                  },
                  "goal_key": {
                    "type": "string",
                    "description": "Slug identifier (auto-generated if omitted). Must be unique per project."
                  },
                  "goal_purpose": {
                    "type": "string",
                    "description": "Intent of the goal. Default: `\"sell\"`. Other values: `\"engage\"`, `\"generate\"`."
                  },
                  "element_url": {
                    "type": "string",
                    "description": "The page URL where the element or form is located. Helps the Mida script know which page to listen on."
                  }
                },
                "required": [
                  "goal_name",
                  "goal_type",
                  "goal_value"
                ]
              },
              "example": {
                "goal_name": "CTA Button Click",
                "goal_type": "clickOnElement",
                "goal_value": ".cta-button",
                "goal_purpose": "sell",
                "element_url": "https://example.com/"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "goal_profile_id": 3003,
                  "goal_key": "cta_button_click",
                  "company_id": 1001
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/hypotheses": {
      "post": {
        "operationId": "createHypothesis",
        "summary": "Create Hypothesis",
        "description": "Add an idea to the project's backlog, with the reasoning behind it and how you rate it.",
        "tags": [
          "Hypotheses"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/create-hypothesis"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "observation": {
                    "type": "string",
                    "description": "What you saw happening. Max 5000 characters"
                  },
                  "problem": {
                    "type": "string",
                    "description": "Why you think it is a problem. Max 5000 characters"
                  },
                  "solution": {
                    "type": "string",
                    "description": "The change you want to test. Max 5000 characters"
                  },
                  "confidence": {
                    "type": "integer",
                    "description": "How sure you are, 1 to 5"
                  },
                  "importance": {
                    "type": "integer",
                    "description": "How much it matters, 1 to 5"
                  },
                  "difficulty": {
                    "type": "integer",
                    "description": "How hard it is to build, 1 to 5"
                  },
                  "hypothesis_url": {
                    "type": "string",
                    "description": "Link to supporting research. Must start with `http://` or `https://`"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "hypothesis": {
                    "hypothesis_id": 4021,
                    "observation": "62% of pricing page visitors on mobile never scroll past the first plan.",
                    "problem": "The plan comparison is three screens tall on a phone.",
                    "solution": "Collapse the comparison into a single card with a plan switcher.",
                    "confidence": 4,
                    "importance": 5,
                    "difficulty": 2,
                    "hypothesis_url": "https://www.notion.so/pricing-mobile-research",
                    "archived": false,
                    "created_at": "2026-08-24T06:12:00.000Z",
                    "updated_at": "2026-08-24T06:12:00.000Z",
                    "linked_test_ids": []
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "get": {
        "operationId": "listHypotheses",
        "summary": "List Hypotheses",
        "description": "Return the project's hypothesis backlog: the ideas the team wrote down, how they rated each one, and which experiments came out of them.",
        "tags": [
          "Hypotheses"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/list-hypotheses"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "none"
            },
            "description": "Only return hypotheses whose observation, problem or solution contains this text."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": "50"
            },
            "description": "Max results to return. Maximum `200`."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": "0"
            },
            "description": "Number of records to skip (for pagination)."
          },
          {
            "name": "include_archived",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": "false"
            },
            "description": "Also return ideas that were archived, each marked `\"archived\": true`. Archived ideas are off the backlog, so they are left out by default."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "hypotheses": [
                    {
                      "hypothesis_id": 4021,
                      "observation": "62% of pricing page visitors on mobile never scroll past the first plan.",
                      "problem": "The plan comparison is three screens tall on a phone, so the cheaper plan is all most people ever see.",
                      "solution": "Collapse the comparison into a single card with a plan switcher.",
                      "confidence": 4,
                      "importance": 5,
                      "difficulty": 2,
                      "hypothesis_url": "https://www.notion.so/pricing-mobile-research",
                      "archived": false,
                      "created_at": "2026-07-02T09:14:00.000Z",
                      "updated_at": "2026-08-19T04:31:00.000Z",
                      "linked_test_ids": [
                        34707,
                        34755
                      ]
                    },
                    {
                      "hypothesis_id": 4034,
                      "observation": "Support gets asked whether the trial needs a card about twice a week.",
                      "problem": null,
                      "solution": "Say \"no card needed\" directly under the signup button.",
                      "confidence": 3,
                      "importance": 4,
                      "difficulty": 1,
                      "hypothesis_url": null,
                      "archived": false,
                      "created_at": "2026-08-11T02:00:00.000Z",
                      "updated_at": "2026-08-11T02:00:00.000Z",
                      "linked_test_ids": []
                    }
                  ],
                  "count": 2,
                  "total": 34,
                  "limit": 50,
                  "offset": 0,
                  "has_more": false,
                  "next_offset": 2
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/personalization/campaigns": {
      "post": {
        "operationId": "createPersonalizationCampaign",
        "summary": "Create Personalization Campaign",
        "description": "Build a new Personalization campaign. Two strategies: accounts researches named companies and writes copy for each, personas writes one version per job role with no company list and no research. Returns a campaign to open, not a finished campaign, and never publishes.",
        "tags": [
          "Personalization"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/create-personalization-campaign"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "strategy": {
                    "type": "string",
                    "description": "**Required.** `\"accounts\"` or `\"personas\"`"
                  },
                  "name": {
                    "type": "string",
                    "description": "Short campaign name. One is invented if you leave it out"
                  },
                  "page_urls": {
                    "type": "array",
                    "items": {},
                    "description": "**Required.** Pages to personalize, on your own site. Take these from Suggested Pages"
                  },
                  "goal_profile_id": {
                    "type": "number",
                    "description": "The conversion that decides whether personalization worked. Optional, but the campaign cannot be launched without one"
                  },
                  "accounts": {
                    "type": "array",
                    "items": {},
                    "description": "**Required when `strategy` is `accounts`.** Entries of `{ \"name\", \"domain\"?, \"notes\"? }`"
                  },
                  "personas": {
                    "type": "array",
                    "items": {},
                    "description": "**Required when `strategy` is `personas`.** Entries of `{ \"label\", \"description\"? }`"
                  },
                  "persona_param": {
                    "type": "string",
                    "description": "`personas` only. The URL parameter carrying the role: `utm_campaign` (default), `utm_term`, `utm_medium`, `utm_source` or `ref`"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "abm_campaign_id": 41,
                  "name": "Q3 enterprise outbound",
                  "url": "/personalize/abm/41",
                  "account_count": 1,
                  "page_urls": [
                    "https://yoursite.com/",
                    "https://yoursite.com/pricing"
                  ],
                  "building": true,
                  "needs_goal": false
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "get": {
        "operationId": "listPersonalizationCampaigns",
        "summary": "List Personalization Campaigns",
        "description": "This project's Personalization campaigns, newest first, with how many accounts each has, how many already have copy, and whether it is building or launched. Call this to find a campaign_id before adding accounts to one.",
        "tags": [
          "Personalization"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/list-personalization-campaigns"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "campaigns": [
                    {
                      "abm_campaign_id": 23,
                      "name": "TechSpo 2026",
                      "status": "launched",
                      "url": "/personalize/abm/23",
                      "account_count": 12,
                      "accounts_with_copy": 11,
                      "launched": true,
                      "building": true,
                      "updated_at": "2026-08-21T04:12:08.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/projects": {
      "post": {
        "operationId": "createProject",
        "summary": "Create Project",
        "description": "Create a new project (website / app) under the same Mida account as the supplied project key. The new project's project_key is auto-generated and returned — use it to install the Mida script on the new site, then mint API keys via the dashboard if needed.",
        "tags": [
          "Projects"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/create-project"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "website_name": {
                    "type": "string",
                    "description": "Display name for the new project"
                  },
                  "name": {
                    "type": "string",
                    "description": "Alias for `website_name`"
                  },
                  "allowed_website": {
                    "type": "string",
                    "description": "Domain(s) the script may run on. Use `*` to allow any."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "get": {
        "operationId": "listProjects",
        "summary": "List Projects",
        "description": "Return every project (website / app) under the same Mida account as the supplied project key. The project key in the URL is used purely as auth context — you'll receive the full list of sibling projects, including the one matched by that key. Lets an external client (e.g. an AI agent) discover and switch between projects.",
        "tags": [
          "Projects"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/list-projects"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": "100"
            },
            "description": "Max projects to return. Maximum `500`."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": "0"
            },
            "description": "Number of records to skip (for pagination)."
          },
          {
            "name": "include_inactive",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": "false"
            },
            "description": "When `true`, also include paused (`status=0`) projects. Soft-deleted projects (`status=2`) are never returned."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "company_id": 1001,
                  "count": 2,
                  "projects": [
                    {
                      "project_key": "PROJECT_KEY_AAAAAAAAAA",
                      "name": "www.example.com",
                      "website_name": "www.example.com",
                      "widget_name": "www.example.com",
                      "allowed_website": "www.example.com",
                      "monthly_average_traffic": 50000,
                      "shopify_id": null,
                      "status": 1,
                      "company_id": 1001,
                      "created_at": "2025-12-04T10:05:52.000Z",
                      "updated_at": "2026-04-21T08:30:00.000Z"
                    },
                    {
                      "project_key": "PROJECT_KEY_BBBBBBBBBB",
                      "name": "store.example.com",
                      "website_name": "store.example.com",
                      "widget_name": "store.example.com",
                      "allowed_website": "store.example.com",
                      "monthly_average_traffic": 0,
                      "shopify_id": "1234567890",
                      "status": 1,
                      "company_id": 1001,
                      "created_at": "2026-03-18T11:20:00.000Z",
                      "updated_at": "2026-04-12T09:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/create-survey": {
      "post": {
        "operationId": "createSurvey",
        "summary": "Create Survey",
        "description": "Create an on-site survey as a draft. Nobody sees it until you set it live.",
        "tags": [
          "Surveys"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/create-survey"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Only your team sees it. Max 120 characters"
                  },
                  "questions": {
                    "type": "array",
                    "items": {},
                    "description": "1 to 10 questions. See Questions and branching"
                  },
                  "trigger": {
                    "type": "string",
                    "description": "When to ask: `time` (after `delay` seconds on the page, the default), `pageviews` (on page views `pageviews.from` to `pageviews.to` of a visit) or `js` (when the site calls `mdq.push(['showSurvey', SURVEY_ID])`)"
                  },
                  "delay": {
                    "type": "integer",
                    "description": "Seconds on the page before asking, 0 to 600. Default `10`"
                  },
                  "pageviews": {
                    "type": "object",
                    "description": "`{ \"from\", \"to\" }` for `trigger: \"pageviews\"`"
                  },
                  "repeat": {
                    "type": "string",
                    "description": "`once` (default): each visitor is asked once. `until_answered`: asked again on later visits until they answer"
                  },
                  "sample": {
                    "type": "integer",
                    "description": "Percent of matching visitors asked, 1 to 100. Default `100`"
                  },
                  "limit": {
                    "type": "object",
                    "description": "`{ \"total\", \"per_day\" }` respondents. `total` ends the survey when reached; `per_day` stops it for the rest of the UTC day. `0` means no limit"
                  },
                  "targeting": {
                    "type": "object",
                    "description": "Which pages and visitors, with the same rules as an experiment: `url_rule`, `parameter_rule`, `cookie_rule` and segment rules. Leave it out to ask on every page"
                  },
                  "intro": {
                    "type": "string",
                    "description": "Optional line above the first question. Max 200 characters"
                  },
                  "thanks": {
                    "type": "string",
                    "description": "Thank-you message. Default \"Thanks for your feedback!\""
                  },
                  "accent": {
                    "type": "string",
                    "description": "Hex color, like `#4f46e5`"
                  },
                  "position": {
                    "type": "string",
                    "description": "`br` (bottom right, default), `bl`, `bc` or `center` (a pop-up)"
                  },
                  "layout": {
                    "type": "string",
                    "description": "`card` shows two or three rating questions on one card. Anything else, and any survey that branches, asks one question at a time"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "survey": {
                    "survey_id": 42,
                    "name": "Who is visiting",
                    "status": "draft",
                    "questions": [
                      {
                        "qid": 1,
                        "type": "choice",
                        "text": "Are you visiting as a student or instructor?",
                        "options": [
                          {
                            "id": 0,
                            "text": "Student",
                            "positive": false
                          },
                          {
                            "id": 1,
                            "text": "Instructor",
                            "positive": false,
                            "next": 3
                          }
                        ],
                        "multi": false,
                        "save_as": "visitor_role"
                      },
                      {
                        "qid": 2,
                        "type": "yesno",
                        "text": "Would you use a free Education Plan?",
                        "next": "end"
                      },
                      {
                        "qid": 3,
                        "type": "yesno",
                        "text": "Would you teach your class with Mida?"
                      }
                    ],
                    "trigger": "time",
                    "delay": 10,
                    "sample": 100,
                    "accent": "#4f46e5",
                    "thanks": "Thanks for your feedback!",
                    "intro": "",
                    "position": "br",
                    "layout": "steps",
                    "pageviews": {
                      "from": 1,
                      "to": 25
                    },
                    "repeat": "once",
                    "targeting": {
                      "url_rule": [
                        {
                          "type": "contains",
                          "value": "/blog/"
                        }
                      ]
                    },
                    "created_at": "2026-10-28T09:12:00.000Z",
                    "updated_at": "2026-10-28T09:12:00.000Z",
                    "started_at": null,
                    "ended_at": null
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/event/{event_id}": {
      "delete": {
        "operationId": "deleteEvent",
        "summary": "Delete Event",
        "description": "Soft-delete an event by setting its status to inactive. The event record is preserved in the database but will no longer appear in the Events dashboard or API list responses.",
        "tags": [
          "Events"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/delete-event"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric event ID to delete"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "event_id": 9876,
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "get": {
        "operationId": "getEventDetails",
        "summary": "Get Event Details",
        "description": "Return the full details of a single event by its ID.",
        "tags": [
          "Events"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-event-details"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric event ID (from Create Event or List Events)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "event": {
                    "event_id": 9876,
                    "event_type": 2,
                    "event_text": "Pricing CTA Clicked",
                    "event_property": "{\"button_id\":\"hero-cta\",\"placement\":\"above-fold\"}",
                    "url": "https://example.com/pricing",
                    "event_path": "/pricing",
                    "status": 1,
                    "created_at": "2024-01-15T10:30:00.000Z"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "patch": {
        "operationId": "updateEvent",
        "summary": "Update Event",
        "description": "Update fields on a single event. Only the fields you include are changed — all other fields remain unchanged.",
        "tags": [
          "Events"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/update-event"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric event ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_text": {
                    "type": "string",
                    "description": "Rename the event"
                  },
                  "event_property": {
                    "type": "object",
                    "description": "Replace the event's metadata"
                  },
                  "url": {
                    "type": "string",
                    "description": "Update the associated page URL"
                  },
                  "event_path": {
                    "type": "string",
                    "description": "Update the associated URL path"
                  },
                  "session": {
                    "type": "string",
                    "description": "Update the session identifier"
                  },
                  "status": {
                    "type": "integer",
                    "description": "`1` = active, `2` = soft-delete"
                  }
                }
              },
              "example": {
                "event_text": "Pricing CTA Clicked — Mobile",
                "event_property": {
                  "device": "mobile",
                  "button_id": "hero-cta"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "event_id": 9876
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/exclusion-groups/{group_id}": {
      "delete": {
        "operationId": "deleteExclusionGroup",
        "summary": "Delete Exclusion Group",
        "description": "Remove a mutually exclusive group. The experiments in it keep running — they just stop being exclusive, so a visitor can enter more than one of them again.",
        "tags": [
          "Exclusion groups"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/delete-exclusion-group"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The group's `id` from List Exclusion Groups"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "group_id": 42,
                  "group_name": "Pricing page tests",
                  "note": "Removed. 2 experiments keep running, but they are no longer exclusive — a visitor can enter more than one of them again."
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "patch": {
        "operationId": "updateExclusionGroup",
        "summary": "Update Exclusion Group",
        "description": "Change an exclusion group's membership, splits, name or description. The tests array REPLACES the whole membership — to add one experiment, send the existing tests plus the new one.",
        "tags": [
          "Exclusion groups"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/update-exclusion-group"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The group's `id` from List Exclusion Groups"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New label"
                  },
                  "description": {
                    "type": "string",
                    "description": "New note"
                  },
                  "tests": {
                    "type": "array",
                    "items": {},
                    "description": "The **complete new membership**, replacing the old. Same rules as Create: at least two entries, percents all-or-none summing to 100"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "group_id": 42,
                  "group_name": "Pricing page tests",
                  "tests": [
                    {
                      "test_id": 34567,
                      "percent": 33
                    },
                    {
                      "test_id": 34580,
                      "percent": 33
                    },
                    {
                      "test_id": 34601,
                      "percent": 34
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/experiment/{test_id}/discussion/{comment_id}": {
      "delete": {
        "operationId": "deleteExperimentComment",
        "summary": "Delete Experiment Comment",
        "description": "Delete one comment from an experiment's Discussion. Allowed for the comment's own author, or an Owner/Admin moderating the thread.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/delete-experiment-comment"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The experiment id"
          },
          {
            "name": "comment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The comment's id from Get Experiment Discussion"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "test_id": 34567,
                  "comment_id": 984,
                  "deleted_preview": "Mobile is flat so far — desktop carrying the lift."
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/experiment/{test_id}": {
      "delete": {
        "operationId": "deleteExperiment",
        "summary": "Delete Experiment",
        "description": "Delete an experiment. It disappears from the Experiments list and, if it was running, stops being served to visitors.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/delete-experiment"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric experiment ID to delete"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "test_id": 34762,
                  "test_name": "Homepage H1 - No-Devs Angle",
                  "deleted": true,
                  "was_live": false,
                  "message": "Experiment deleted."
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "get": {
        "operationId": "getExperimentDetails",
        "summary": "Get Experiment Details",
        "description": "Return full details for one experiment, including its variants, goals, targeting rules, and configuration.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-experiment-details"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric experiment ID (from Create Experiment or List Experiments)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "experiment": {
                    "test_id": 1234,
                    "test_name": "Homepage CTA Button Color Test",
                    "url": "https://example.com/",
                    "status": 9,
                    "created_at": "2024-01-15T10:30:00.000Z",
                    "updated_at": "2024-01-20T14:22:00.000Z",
                    "goal_profile_id": 99,
                    "variants": [
                      {
                        "variant_id": 1,
                        "name": "Control",
                        "customCSS": "",
                        "customJS": "",
                        "data": []
                      },
                      {
                        "variant_id": 2,
                        "name": "Variant 1 — Red Button",
                        "customCSS": ".cta-button { background-color: #FF5733 !important; }",
                        "customJS": "",
                        "data": []
                      }
                    ],
                    "configuration": {
                      "traffic_allocation": 100,
                      "confidence_interval": 95
                    },
                    "targeting": {
                      "devices": [],
                      "browsers": [],
                      "countries": []
                    },
                    "primary_goal": {
                      "goal_profile_id": 99,
                      "goal_name": "CTA Button Click",
                      "goal_type": "clickOnElement",
                      "goal_value": ".cta-button"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "patch": {
        "operationId": "updateExperiment",
        "summary": "Update Experiment",
        "description": "Update an experiment's name, URL, variants, configuration, custom code, targeting, or secondary metrics. Only fields you include are changed; all other fields remain unchanged.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/update-experiment"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric experiment ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "test_name": {
                    "type": "string",
                    "description": "New display name for the experiment"
                  },
                  "url": {
                    "type": "string",
                    "description": "Change the test page URL"
                  },
                  "variants": {
                    "type": "array",
                    "items": {},
                    "description": "**Replaces** every treatment variant. Send the ones you are keeping as well — see the warning below. Same shape as Create Experiment"
                  },
                  "variants_data_key": {
                    "type": "string",
                    "description": "Which key inside the experiment's stored variant data your `variants` array writes to. Required when editing variants on a multi-page or sitewide test — see below"
                  },
                  "control": {
                    "type": "object",
                    "description": "Update Control nickname/custom JS/custom CSS helper fields"
                  },
                  "control_attr": {
                    "type": "object",
                    "description": "Raw Control attributes (`name`, `js`, `css`) if you are not using `control`"
                  },
                  "custom_js": {
                    "type": "string",
                    "description": "Experiment-wide JavaScript applied to all assigned visitors, including Control"
                  },
                  "custom_css": {
                    "type": "string",
                    "description": "Experiment-wide CSS applied to all assigned visitors, including Control"
                  },
                  "configuration": {
                    "type": "object",
                    "description": "Update traffic, statistics, automation, or trigger settings"
                  },
                  "targeting": {
                    "type": "object",
                    "description": "Update experiment-level targeting rules"
                  },
                  "sitewide": {
                    "type": "boolean",
                    "description": "Confirms the experiment should run on every page. Only needed when this update would leave its variants stored for all pages with no URL rule. See Changing the pages an experiment runs on"
                  },
                  "tags": {
                    "type": "array",
                    "items": {},
                    "description": "Experiment tags for organization"
                  },
                  "secondary_goal_keys": {
                    "type": "array",
                    "items": {},
                    "description": "Replace the goal-based secondary metrics with these goals, referenced by key"
                  }
                }
              },
              "example": {
                "test_name": "Homepage CTA Button Color Test (Revised)",
                "configuration": {
                  "traffic_allocation": 80,
                  "confidence_interval": 95
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "test_id": 1234,
                  "updated_fields": [
                    "test_device_rule",
                    "targeting",
                    "updated_at"
                  ],
                  "saved_targeting": {
                    "runs_on": "pages allowed by url_rule",
                    "url_rule": [
                      {
                        "allowed": true,
                        "url": "/products/",
                        "rule": "contain"
                      }
                    ],
                    "data_keys": [
                      "https://*"
                    ],
                    "targeting": {
                      "url_rule": [
                        {
                          "allowed": true,
                          "url": "/products/",
                          "rule": "contain"
                        }
                      ],
                      "device_rule": [
                        "desktop"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/goal/{goal_profile_id}": {
      "delete": {
        "operationId": "deleteGoal",
        "summary": "Delete Goal",
        "description": "Soft-delete a goal profile. The record is preserved in the database but will no longer appear in the Goals list or be selectable for new experiments.",
        "tags": [
          "Goals"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/delete-goal"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "goal_profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric goal profile ID to delete"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "goal_profile_id": 3003,
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "get": {
        "operationId": "getGoalDetails",
        "summary": "Get Goal Details",
        "description": "Return the full definition of a single goal profile by its ID.",
        "tags": [
          "Goals"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-goal-details"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "goal_profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric goal profile ID (from Create Goal or List Goals)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "goal": {
                    "goal_profile_id": 3003,
                    "goal_key": "cta_button_click",
                    "goal_name": "CTA Button Click",
                    "goal_type": "clickOnElement",
                    "goal_value": ".cta-button",
                    "goal_purpose": "sell",
                    "element_url": "https://example.com/",
                    "status": 1,
                    "created_at": "2024-01-15T10:30:00.000Z"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "patch": {
        "operationId": "updateGoal",
        "summary": "Update Goal",
        "description": "Update fields on a goal profile. Only the fields you include are changed — all other fields remain unchanged.",
        "tags": [
          "Goals"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/update-goal"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "goal_profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric goal profile ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "goal_name": {
                    "type": "string",
                    "description": "Rename the goal"
                  },
                  "goal_type": {
                    "type": "string",
                    "description": "Change the conversion type"
                  },
                  "goal_value": {
                    "type": "string",
                    "description": "Change the selector, URL, or trigger value"
                  },
                  "goal_purpose": {
                    "type": "string",
                    "description": "Update the intent (`\"sell\"`, `\"engage\"`, `\"generate\"`)"
                  },
                  "goal_key": {
                    "type": "string",
                    "description": "Change the slug (must remain unique per project)"
                  },
                  "element_url": {
                    "type": "string",
                    "description": "Update the associated page URL"
                  }
                }
              },
              "example": {
                "goal_name": "CTA Button Click — Above Fold",
                "goal_value": ".cta-button.above-fold"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "goal_profile_id": 3003
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/hypotheses/{hypothesis_id}": {
      "delete": {
        "operationId": "deleteHypothesis",
        "summary": "Delete Hypothesis",
        "description": "Remove an idea from the backlog. A hypothesis that experiments were run from cannot be deleted.",
        "tags": [
          "Hypotheses"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/delete-hypothesis"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hypothesis_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The ID from List Hypotheses"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "deleted": true,
                  "hypothesis_id": 4034
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "get": {
        "operationId": "getHypothesisDetails",
        "summary": "Get Hypothesis Details",
        "description": "Return one hypothesis, including every experiment that has been run from it.",
        "tags": [
          "Hypotheses"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-hypothesis-details"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hypothesis_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The ID from List Hypotheses"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "hypothesis": {
                    "hypothesis_id": 4021,
                    "observation": "62% of pricing page visitors on mobile never scroll past the first plan.",
                    "problem": "The plan comparison is three screens tall on a phone.",
                    "solution": "Collapse the comparison into a single card with a plan switcher.",
                    "confidence": 4,
                    "importance": 5,
                    "difficulty": 2,
                    "hypothesis_url": "https://www.notion.so/pricing-mobile-research",
                    "archived": false,
                    "created_at": "2026-07-02T09:14:00.000Z",
                    "updated_at": "2026-08-19T04:31:00.000Z",
                    "linked_test_ids": [
                      34707,
                      34755
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "patch": {
        "operationId": "updateHypothesis",
        "summary": "Update Hypothesis",
        "description": "Change the wording or the ratings on an existing hypothesis. Fields you leave out are not touched.",
        "tags": [
          "Hypotheses"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/update-hypothesis"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hypothesis_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The ID from List Hypotheses"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "observation": {
                    "type": "string",
                    "description": "What you saw happening. Empty string clears it"
                  },
                  "problem": {
                    "type": "string",
                    "description": "Why you think it is a problem. Empty string clears it"
                  },
                  "solution": {
                    "type": "string",
                    "description": "The change you want to test. Empty string clears it"
                  },
                  "confidence": {
                    "type": "integer",
                    "description": "1 to 5"
                  },
                  "importance": {
                    "type": "integer",
                    "description": "1 to 5"
                  },
                  "difficulty": {
                    "type": "integer",
                    "description": "1 to 5"
                  },
                  "hypothesis_url": {
                    "type": "string",
                    "description": "Link to supporting research"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "hypothesis": {
                    "hypothesis_id": 4021,
                    "observation": "62% of pricing page visitors on mobile never scroll past the first plan.",
                    "problem": "The plan comparison is three screens tall on a phone.",
                    "solution": "Show one plan by default with a switcher for the rest.",
                    "confidence": 4,
                    "importance": 3,
                    "difficulty": 2,
                    "hypothesis_url": "https://www.notion.so/pricing-mobile-research",
                    "archived": false,
                    "created_at": "2026-07-02T09:14:00.000Z",
                    "updated_at": "2026-08-24T06:20:00.000Z",
                    "linked_test_ids": [
                      34707,
                      34755
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}": {
      "delete": {
        "operationId": "deleteProject",
        "summary": "Delete Project",
        "description": "Soft-delete a project. The project disappears from list / get responses but all experiments, events, and visitor data are retained for billing, history, and compliance. There is no hard-delete endpoint — for a permanent wipe (e.g. GDPR) contact Mida support.",
        "tags": [
          "Projects"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/delete-project"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The project to delete"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "project_key": "PROJECT_KEY_AAAAAAAAAA",
                  "status": 2,
                  "message": "Project deleted (soft delete; data retained)"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "get": {
        "operationId": "getProjectDetails",
        "summary": "Get Project Details",
        "description": "Return details for a single project. The API key must be valid for the supplied project key (or any sibling project under the same company).",
        "tags": [
          "Projects"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-project-details"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The 22-char project key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "project": {
                    "project_key": "PROJECT_KEY_AAAAAAAAAA",
                    "name": "www.example.com",
                    "website_name": "www.example.com",
                    "widget_name": "www.example.com",
                    "allowed_website": "www.example.com",
                    "monthly_average_traffic": 50000,
                    "shopify_id": null,
                    "status": 1,
                    "company_id": 1001,
                    "created_at": "2025-12-04T10:05:52.000Z",
                    "updated_at": "2026-04-21T08:30:00.000Z"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "patch": {
        "operationId": "updateProject",
        "summary": "Update Project",
        "description": "Update mutable fields on a project. Only the whitelisted fields below are accepted — anything else in the body is silently ignored, so the API surface stays predictable.",
        "tags": [
          "Projects"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/update-project"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "website_name": {
                    "type": "string",
                    "description": "Display name"
                  },
                  "name": {
                    "type": "string",
                    "description": "Alias for `website_name`"
                  },
                  "widget_name": {
                    "type": "string",
                    "description": "Internal alias (usually mirrors `website_name`)"
                  },
                  "allowed_website": {
                    "type": "string",
                    "description": "Domain(s) the script may run on (`*` = any)"
                  },
                  "widget_allowed_website": {
                    "type": "string",
                    "description": "Alias for `allowed_website`"
                  },
                  "monthly_average_traffic": {
                    "type": "integer",
                    "description": "Hint used for plan suggestions"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "project": {
                    "project_key": "PROJECT_KEY_AAAAAAAAAA",
                    "name": "store.example.com (EU)",
                    "website_name": "store.example.com (EU)",
                    "monthly_average_traffic": 120000,
                    "...": "..."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/survey/{survey_id}": {
      "delete": {
        "operationId": "deleteSurvey",
        "summary": "Delete Survey",
        "description": "Archive a survey: off the site and off the list. Its answers stay.",
        "tags": [
          "Surveys"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/delete-survey"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "survey_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "survey_id": 42,
                  "status": "archived"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "get": {
        "operationId": "getSurveyDetails",
        "summary": "Get Survey Details",
        "description": "One survey: its questions and branching, when it asks, its look, limits and page targeting.",
        "tags": [
          "Surveys"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-survey-details"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "survey_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "survey": {
                    "survey_id": 42,
                    "name": "Who is visiting",
                    "status": "live",
                    "questions": [
                      {
                        "qid": 1,
                        "type": "choice",
                        "text": "Are you visiting as a student or instructor?",
                        "options": [
                          {
                            "id": 0,
                            "text": "Student",
                            "positive": false
                          },
                          {
                            "id": 1,
                            "text": "Instructor",
                            "positive": false,
                            "next": 3
                          }
                        ],
                        "multi": false,
                        "save_as": "visitor_role"
                      },
                      {
                        "qid": 2,
                        "type": "yesno",
                        "text": "Would you use a free Education Plan?",
                        "next": "end"
                      },
                      {
                        "qid": 3,
                        "type": "yesno",
                        "text": "Would you teach your class with Mida?"
                      }
                    ],
                    "trigger": "time",
                    "delay": 10,
                    "sample": 100,
                    "accent": "#4f46e5",
                    "thanks": "Thanks for your feedback!",
                    "intro": "",
                    "position": "br",
                    "layout": "steps",
                    "pageviews": {
                      "from": 1,
                      "to": 25
                    },
                    "repeat": "once",
                    "targeting": {
                      "url_rule": [
                        {
                          "type": "contains",
                          "value": "/blog/"
                        }
                      ]
                    },
                    "created_at": "2026-10-28T09:12:00.000Z",
                    "updated_at": "2026-10-28T09:12:00.000Z",
                    "started_at": null,
                    "ended_at": null,
                    "answers_per_question": {
                      "1": 8,
                      "2": 5,
                      "3": 2
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "patch": {
        "operationId": "updateSurvey",
        "summary": "Update Survey",
        "description": "Change a survey's questions, settings or targeting. Only the fields you send change.",
        "tags": [
          "Surveys"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/update-survey"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "survey_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Only your team sees it. Max 120 characters"
                  },
                  "questions": {
                    "type": "array",
                    "items": {},
                    "description": "1 to 10 questions. See Questions and branching"
                  },
                  "trigger": {
                    "type": "string",
                    "description": "When to ask: `time` (after `delay` seconds on the page, the default), `pageviews` (on page views `pageviews.from` to `pageviews.to` of a visit) or `js` (when the site calls `mdq.push(['showSurvey', SURVEY_ID])`)"
                  },
                  "delay": {
                    "type": "integer",
                    "description": "Seconds on the page before asking, 0 to 600. Default `10`"
                  },
                  "pageviews": {
                    "type": "object",
                    "description": "`{ \"from\", \"to\" }` for `trigger: \"pageviews\"`"
                  },
                  "repeat": {
                    "type": "string",
                    "description": "`once` (default): each visitor is asked once. `until_answered`: asked again on later visits until they answer"
                  },
                  "sample": {
                    "type": "integer",
                    "description": "Percent of matching visitors asked, 1 to 100. Default `100`"
                  },
                  "limit": {
                    "type": "object",
                    "description": "`{ \"total\", \"per_day\" }` respondents. `total` ends the survey when reached; `per_day` stops it for the rest of the UTC day. `0` means no limit"
                  },
                  "targeting": {
                    "type": "object",
                    "description": "Which pages and visitors, with the same rules as an experiment: `url_rule`, `parameter_rule`, `cookie_rule` and segment rules. Leave it out to ask on every page"
                  },
                  "intro": {
                    "type": "string",
                    "description": "Optional line above the first question. Max 200 characters"
                  },
                  "thanks": {
                    "type": "string",
                    "description": "Thank-you message. Default \"Thanks for your feedback!\""
                  },
                  "accent": {
                    "type": "string",
                    "description": "Hex color, like `#4f46e5`"
                  },
                  "position": {
                    "type": "string",
                    "description": "`br` (bottom right, default), `bl`, `bc` or `center` (a pop-up)"
                  },
                  "layout": {
                    "type": "string",
                    "description": "`card` shows two or three rating questions on one card. Anything else, and any survey that branches, asks one question at a time"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/experiment/{test_id}/distribution": {
      "get": {
        "operationId": "getExperimentDistribution",
        "summary": "Get Experiment Distribution",
        "description": "Return configured per-variant traffic splits for an experiment — a compact alternative to Get Experiment Details when you only need allocation weights.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-experiment-distribution"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric experiment ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "test_id": 1234,
                  "test_name": "Homepage CTA Button Color Test",
                  "status": "live",
                  "traffic_allocation": 100,
                  "distribution_mode": "custom",
                  "is_mab": false,
                  "variants": [
                    {
                      "variant_id": "0",
                      "name": "Control",
                      "traffic_weight": 50,
                      "variant_status": "active"
                    },
                    {
                      "variant_id": "1",
                      "name": "Red CTA Button",
                      "traffic_weight": 50,
                      "variant_status": "active"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/experiment/{test_id}/metrics": {
      "get": {
        "operationId": "getExperimentMetrics",
        "summary": "Get Experiment Metrics",
        "description": "Return dashboard-parity secondary metric rows for an experiment, with optional metric selection, date filtering, and dashboard-compatible filters.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-experiment-metrics"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric experiment ID"
          },
          {
            "name": "metric_keys",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Metric or goal keys to retrieve instead of all attached secondary metrics. Accepts a comma-separated string or JSON array."
          },
          {
            "name": "goal_keys",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Goal keys to retrieve as secondary metrics. Alias for `metric_keys` when goals are known."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter conversions from this date. Format: `YYYY-MM-DD`."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter conversions through this date. Format: `YYYY-MM-DD`."
          },
          {
            "name": "filter_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Dashboard preset segment filter such as `mobile`, `desktop`, `new`, `returning`, `paid`, `search`, `direct`, or `country-US`."
          },
          {
            "name": "custom_filter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Dashboard custom segment rules in the same nested rule shape used by the dashboard segment builder."
          },
          {
            "name": "metric_batch",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional zero-based dashboard metric indexes to compute."
          },
          {
            "name": "tz",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Dashboard timezone hour offset used for date filtering. Defaults to `0`."
          },
          {
            "name": "report_phase",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Which conversion period to include: `pre_deploy`, `post_deploy`, or `all_time`. Same semantics as Get Experiment Result."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "test_id": 1234,
                  "test_name": "Homepage CTA Button Color Test",
                  "count": 2,
                  "metric_count": 1,
                  "metric_definitions": [
                    {
                      "metric_key": "purchase",
                      "metric_text": "goal_purchase",
                      "name": "Purchase",
                      "type": 2,
                      "goal": {
                        "goal_key": "purchase",
                        "goal_name": "Purchase",
                        "goal_type": "revenue",
                        "goal_value": "Purchase"
                      }
                    }
                  ],
                  "metrics": [
                    {
                      "variant_id": "0",
                      "total": 1500,
                      "result_1": 40
                    },
                    {
                      "variant_id": "1",
                      "total": 1480,
                      "result_1": 52
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/experiment/{test_id}/preview-urls": {
      "get": {
        "operationId": "getExperimentPreviewUrls",
        "summary": "Get Experiment Preview URLs",
        "description": "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.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-experiment-preview-urls"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project key (the `key=` value in the Mida script tag)."
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Numeric experiment ID. Get this from List Experiments."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "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=0"
                    },
                    {
                      "variant_id": 1,
                      "name": "Variant 1",
                      "preview_url": "https://example.com/?test-preview=1234&test-variant=Variant_1"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/experiment/{test_id}/result": {
      "get": {
        "operationId": "getExperimentResult",
        "summary": "Get Experiment Result",
        "description": "Return dashboard-parity conversion results for an experiment, with optional goal drilldowns, dashboard-compatible filters, and breakdowns.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-experiment-result"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric experiment ID"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter conversions from this date. Format: `YYYY-MM-DD`."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter conversions through this date. Format: `YYYY-MM-DD`."
          },
          {
            "name": "goal_key",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Drill into a specific primary or secondary goal by `goal_key`. If omitted, the experiment's attached primary goal is used when present; otherwise the project's global primary goal from Get Project Configuration is used."
          },
          {
            "name": "goal_profile_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Drill into a specific goal by internal goal ID. Prefer `goal_key` when available."
          },
          {
            "name": "filter_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Dashboard preset segment filter such as `mobile`, `desktop`, `new`, `returning`, `paid`, `search`, `direct`, or `country-US`."
          },
          {
            "name": "custom_filter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Dashboard custom segment rules in the same nested rule shape used by the dashboard segment builder."
          },
          {
            "name": "breakdown_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Segment results by a dashboard-supported dimension. See Supported breakdowns."
          },
          {
            "name": "event_attribute",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {}
            },
            "description": "Dashboard event attribute filters for event, revenue, and script goals. Use the dashboard nested condition shape. See Event attribute filters."
          },
          {
            "name": "min_count",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Minimum matching event count per visitor for event-backed goals. Defaults to `1`."
          },
          {
            "name": "timeframe_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Event conversion window in days after test entry for event-backed goals."
          },
          {
            "name": "tz",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Dashboard timezone hour offset used for date filtering. Defaults to `0`."
          },
          {
            "name": "report_phase",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Which conversion period to include: `pre_deploy` (experiment split only), `post_deploy` (after Set winner & serve), or `all_time` (both). Defaults to `pre_deploy` when the experiment is actively serving a winner."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "test_id": 1234,
                  "test_name": "Homepage CTA Button Color Test",
                  "status": "live",
                  "status_code": 1,
                  "start_date": "2024-01-15T10:30:00.000Z",
                  "end_date": null,
                  "days_running": 15,
                  "primary_goal": {
                    "goal_name": "CTA Button Click",
                    "goal_type": "clickOnElement",
                    "goal_value": ".cta-button"
                  },
                  "stats_engine": "bayesian",
                  "confidence_threshold_percent": 95,
                  "serving_variant_id": "1",
                  "is_serving": true,
                  "report_phase": "pre_deploy",
                  "traffic_allocation": 100,
                  "distribution_mode": "equal",
                  "is_mab": false,
                  "total_visitors": 2980,
                  "total_conversions": 268,
                  "has_revenue": true,
                  "total_revenue": 12450,
                  "total_orders": 312,
                  "rpv": 4.18,
                  "aov": 39.9,
                  "currency": "USD",
                  "variants": [
                    {
                      "variant_id": "0",
                      "name": "Control",
                      "visitors": 1500,
                      "conversions": 120,
                      "conversion_rate": 8,
                      "revenue": 5800,
                      "orders": 145,
                      "rpv": 3.87,
                      "aov": 40,
                      "currency": "USD",
                      "traffic_weight": 50,
                      "variant_status": "active",
                      "is_control": true
                    },
                    {
                      "variant_id": "1",
                      "name": "Red CTA Button",
                      "visitors": 1480,
                      "conversions": 148,
                      "conversion_rate": 10,
                      "improvement": 25,
                      "revenue": 6650,
                      "orders": 167,
                      "rpv": 4.49,
                      "aov": 39.82,
                      "currency": "USD",
                      "revenue_per_visitor_improvement": 16.02,
                      "traffic_weight": 50,
                      "variant_status": "active",
                      "is_control": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/experiment/{test_id}/share-link": {
      "get": {
        "operationId": "getExperimentShareLink",
        "summary": "Get Experiment Share Link",
        "description": "Return the public share link for an experiment's results page. Share links let anyone view experiment results without logging in.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-experiment-share-link"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric experiment ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "test_id": 1234,
                  "company_id": 1001,
                  "share_link": "https://us.mida.so/share/abResult/1234/AbC123xY",
                  "is_public": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/experiment/{test_id}/timeseries": {
      "get": {
        "operationId": "getExperimentTimeseries",
        "summary": "Get Experiment Timeseries",
        "description": "Return dashboard-parity daily chart rows for an experiment using the same backend raw report engine as the Mida dashboard.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-experiment-timeseries"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric experiment ID"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter chart rows from this date. Format: `YYYY-MM-DD`."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter chart rows through this date. Format: `YYYY-MM-DD`."
          },
          {
            "name": "goal_key",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Drill into a specific primary or secondary goal by `goal_key`. If omitted, the experiment's attached primary goal is used when present; otherwise the project's global primary goal from Get Project Configuration is used."
          },
          {
            "name": "goal_profile_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Drill into a specific goal by internal goal ID. Prefer `goal_key` when available."
          },
          {
            "name": "filter_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Dashboard preset segment filter such as `mobile`, `desktop`, `new`, `returning`, `paid`, `search`, `direct`, or `country-US`."
          },
          {
            "name": "custom_filter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Dashboard custom segment rules in the same nested rule shape used by the dashboard segment builder."
          },
          {
            "name": "event_attribute",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {}
            },
            "description": "Dashboard event attribute filters for event, revenue, and script goals. Use the dashboard nested condition shape."
          },
          {
            "name": "min_count",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Minimum matching event count per visitor for event-backed goals. Defaults to `1`."
          },
          {
            "name": "timeframe_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Event conversion window in days after test entry for event-backed goals."
          },
          {
            "name": "tz",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Dashboard timezone hour offset used for date filtering. Defaults to `0`."
          },
          {
            "name": "report_phase",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Which conversion period to include: `pre_deploy`, `post_deploy`, or `all_time`. Same semantics as Get Experiment Result."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "test_id": 1234,
                  "test_name": "Homepage CTA Button Color Test",
                  "goal": {
                    "goal_profile_id": 5678,
                    "goal_key": "purchase",
                    "goal_name": "Purchase",
                    "goal_type": "revenue",
                    "goal_value": "Purchase",
                    "is_primary": true
                  },
                  "count": 2,
                  "timeseries": [
                    {
                      "variant_id": "0",
                      "converted": 12,
                      "conversion": 8,
                      "visitors": 150,
                      "revenue": 1200,
                      "currency": "USD",
                      "created_at": "2024-01-15T00:00:00.000Z",
                      "updated_at": "2024-01-15T00:00:00.000Z"
                    },
                    {
                      "variant_id": "1",
                      "converted": 18,
                      "conversion": 12,
                      "visitors": 150,
                      "revenue": 1620,
                      "currency": "USD",
                      "created_at": "2024-01-15T00:00:00.000Z",
                      "updated_at": "2024-01-15T00:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/global-custom-code": {
      "get": {
        "operationId": "getGlobalCustomCode",
        "summary": "Get Global Custom Code",
        "description": "Return the project's Global Custom Code: JavaScript and CSS that already run on every page with the Mida pixel. Empty strings mean nothing is set yet. Call this before appending a custom-event snippet so existing code is kept.",
        "tags": [
          "Projects"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-global-custom-code"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "js": "window.mdq = window.mdq || [];\nwindow.mdq.push([\"track\", \"signup\", { \"value\": 1 }]);",
                  "css": "",
                  "js_bytes": 78,
                  "css_bytes": 0,
                  "note": "This already runs on every page with the Mida pixel. To add a custom event, APPEND with update_global_custom_code (append_js) so the existing code stays."
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "patch": {
        "operationId": "updateGlobalCustomCode",
        "summary": "Update Global Custom Code",
        "description": "Install JavaScript or CSS into Global Custom Code, which already runs on every page with the Mida pixel. Prefer append_js / append_css so existing code is kept. Use js / css only when you mean to replace the whole file. This is how a custom event is installed without changing the customer's site.",
        "tags": [
          "Projects"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/update-global-custom-code"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "append_js": {
                    "type": "string",
                    "description": "JavaScript to **add** to whatever is already in Global Custom JS. Use this for a new event snippet"
                  },
                  "append_css": {
                    "type": "string",
                    "description": "CSS to **add** to whatever is already in Global Custom CSS"
                  },
                  "js": {
                    "type": "string",
                    "description": "**Replaces** all of Global Custom JS. Send the complete file, including everything that should stay"
                  },
                  "css": {
                    "type": "string",
                    "description": "**Replaces** all of Global Custom CSS. Send the complete file, including everything that should stay"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "js_bytes": 156,
                  "css_bytes": 0,
                  "appended_js": true,
                  "replaced_js": false,
                  "appended_css": false,
                  "replaced_css": false,
                  "note": "Saved (appended JavaScript). It runs on every page with the Mida pixel, so nothing on their site needs to change. A custom event shows on /events the first time it fires."
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/account/my-access": {
      "get": {
        "operationId": "getMyAccess",
        "summary": "Get My Access",
        "description": "The caller's own effective role on this project: what they are allowed to do, and why. Answers 'am I view-only?' for the current connection.",
        "tags": [
          "Account"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-my-access"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "authenticated_as": "user",
                  "role": 1,
                  "role_label": "Admin",
                  "can_edit": true,
                  "note": "Can view and change experiments, goals, events and settings on this project."
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/personalization/campaigns/{campaign_id}": {
      "get": {
        "operationId": "getPersonalizationCampaign",
        "summary": "Get Personalization Campaign",
        "description": "One campaign in enough detail to answer how a build is going and what is left: the stage it reached, how many accounts were researched and had copy written, which failed and why, and whether it still needs a goal before it can be launched.",
        "tags": [
          "Personalization"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-personalization-campaign"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "campaign_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "From List Personalization Campaigns"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "abm_campaign_id": 23,
                  "name": "TechSpo 2026",
                  "status": "launched",
                  "launched": true,
                  "needs_goal": false,
                  "account_count": 12,
                  "accounts_with_copy": 11,
                  "pipeline": {
                    "status": "running",
                    "stage": "copy",
                    "research": {
                      "total": 1,
                      "done": 1,
                      "failed": 0
                    },
                    "copy": {
                      "total": 1,
                      "done": 0,
                      "failed": 0
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "patch": {
        "operationId": "setPersonalizationGoal",
        "summary": "Set the Goal on a Personalization Campaign",
        "description": "Attach a goal to a campaign that already exists, or change the one it has. A campaign cannot be launched without a goal, and a campaign created without one reports needs_goal until this is called.",
        "tags": [
          "Personalization"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/set-personalization-goal"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "campaign_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The campaign to set the goal on. From List Personalization Campaigns"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "goal_profile_id": {
                    "type": "number",
                    "description": "**Required.** The goal that decides whether the personalization worked. From List Goals; create one first with Create Goal if none fits"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "abm_campaign_id": 23,
                  "name": "B2B Growth Marketers",
                  "url": "/personalize/abm/23",
                  "goal": {
                    "goal_profile_id": 969,
                    "goal_name": "Created an account",
                    "goal_type": "script"
                  },
                  "previous_goal_profile_id": null,
                  "changed": true,
                  "launched": false,
                  "needs_goal": false,
                  "_note": "The campaign can now be launched from its page once the copy has been reviewed."
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/configuration": {
      "get": {
        "operationId": "getProjectConfiguration",
        "summary": "Get Project Configuration",
        "description": "Return project-level Global Settings: default primary goal, secondary metrics, stats engine, and confidence threshold. Experiments without an attached primary goal use this default when you call Get Experiment Result or Get Experiment Timeseries without goal_key.",
        "tags": [
          "Projects"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-project-configuration"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "configuration": {
                    "analysis_method": "1",
                    "frequentist_type": "0",
                    "confidence_level": "95",
                    "stats_engine": "bayesian",
                    "confidence_threshold_percent": 95,
                    "weekly_ai_summary_enabled": false,
                    "primary_goal_id": 3003,
                    "primary_goal": {
                      "goal_profile_id": 3003,
                      "goal_key": "cta_button_click",
                      "goal_name": "CTA Button Click",
                      "goal_type": "clickOnElement",
                      "goal_value": ".cta-button"
                    },
                    "secondary_goals": [
                      {
                        "type": 2,
                        "text": "goal_3004",
                        "name": "Add to Cart",
                        "goal_profile_id": 3004,
                        "goal_key": "add_to_cart",
                        "goal_type": "event",
                        "goal_value": "AddToCart"
                      },
                      {
                        "type": 2,
                        "text": "Purchase",
                        "name": "Purchase",
                        "event_name": "Purchase"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      },
      "patch": {
        "operationId": "updateProjectConfiguration",
        "summary": "Update Project Configuration",
        "description": "Update project-level Global Settings: the default primary goal, secondary metrics, stats engine, and confidence level that every newly created experiment inherits. Partial update: send only the fields you want to change. Existing experiments are not touched.",
        "tags": [
          "Projects"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/update-project-configuration"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "analysis_method": {
                    "type": "string",
                    "description": "`\"1\"` Bayesian (default), `\"0\"` Frequentist"
                  },
                  "frequentist_type": {
                    "type": "string",
                    "description": "Frequentist only: `\"0\"` one-tailed, `\"2\"` two-tailed"
                  },
                  "confidence_level": {
                    "type": "number",
                    "description": "Confidence threshold percent, 50–99"
                  },
                  "primary_goal_key": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "`goal_key` of the default primary goal. `null` clears it. Must belong to this project"
                  },
                  "secondary_goals": {
                    "type": "array",
                    "items": {},
                    "description": "**Replaces** the whole secondary metric list. Entries are `{ \"goal_key\": \"...\" }` for goals, or `{ \"text\": \"...\", \"name\": \"...\" }` for built-in metrics (`BounceRate`, `_engagement`, `_pageview`) and custom event names. `[]` clears the list"
                  },
                  "weekly_ai_summary_enabled": {
                    "type": "boolean",
                    "description": "Weekly AI summary email"
                  },
                  "skip_pre_publish_check": {
                    "type": "boolean",
                    "description": "Skip the pre-publish QA check"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "configuration": {
                    "analysis_method": "1",
                    "frequentist_type": "0",
                    "confidence_level": "90",
                    "primary_goal_id": 3003,
                    "secondary_goals": [
                      {
                        "type": 2,
                        "text": "goal_3004",
                        "name": "Add to Cart",
                        "attributeFilter": null
                      },
                      {
                        "type": 2,
                        "text": "BounceRate",
                        "name": "Bounce Rate",
                        "attributeFilter": null
                      }
                    ],
                    "weekly_ai_summary_enabled": false,
                    "skip_pre_publish_check": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/survey/{survey_id}/responses": {
      "get": {
        "operationId": "getSurveyResponses",
        "summary": "Get Survey Responses",
        "description": "One row per person who answered, newest first, with where they came from.",
        "tags": [
          "Surveys"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-survey-responses"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "survey_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Rows per page, 1 to 100. Default 50"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Rows to skip, for paging"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only people who gave all of these answers, up to 5. Each `{ \"question\", \"is\" }`: a question number and the answer: a choice answer's `id`, `\"yes\"` / `\"no\"`, an NPS group (`\"promoter\"`, `\"passive\"`, `\"detractor\"`) or a score. Open-text questions can't be filtered on"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`YYYY-MM-DD`, in the timezone of the `tz` header (hours from UTC, default 0)"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`YYYY-MM-DD`"
          },
          {
            "name": "segment",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A quick segment, as on the experiment report: `new`, `returning`, `desktop`, `mobile`, `direct`, `referral`, `social`, or `country-XX`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "responses": [
                    {
                      "answered_at": "2026-10-27 21:08:54",
                      "answers": {
                        "1": "Instructor",
                        "3": "Yes"
                      },
                      "device": "Mobile",
                      "source": "chatgpt.com",
                      "country": "DZ",
                      "email": ""
                    },
                    {
                      "answered_at": "2026-10-27 13:07:51",
                      "answers": {
                        "1": "Student",
                        "2": "No"
                      },
                      "device": "Desktop",
                      "source": "google.com",
                      "country": "US",
                      "email": ""
                    }
                  ],
                  "more": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/survey/{survey_id}/results": {
      "get": {
        "operationId": "getSurveyResults",
        "summary": "Get Survey Results",
        "description": "The survey's report: the funnel and every question's answers, filtered to a group or compared across groups.",
        "tags": [
          "Surveys"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/get-survey-results"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "survey_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only people who gave all of these answers, up to 5. Each `{ \"question\", \"is\" }`: a question number and the answer: a choice answer's `id`, `\"yes\"` / `\"no\"`, an NPS group (`\"promoter\"`, `\"passive\"`, `\"detractor\"`) or a score. Open-text questions can't be filtered on"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`YYYY-MM-DD`, in the timezone of the `tz` header (hours from UTC, default 0)"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`YYYY-MM-DD`"
          },
          {
            "name": "segment",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A quick segment, as on the experiment report: `new`, `returning`, `desktop`, `mobile`, `direct`, `referral`, `social`, or `country-XX`"
          },
          {
            "name": "compare",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "A question number. Every other question's answers are split by that question's answers, for example students versus instructors. Works with choice, Yes / No, NPS and rating questions"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "funnel": {
                    "shown": 2,
                    "answered": 2,
                    "completed": 2
                  },
                  "questions": [
                    {
                      "question": 1,
                      "qid": 1,
                      "type": "choice",
                      "text": "Are you visiting as a student or instructor?",
                      "n": 2,
                      "multi": false,
                      "options": [
                        {
                          "id": 0,
                          "text": "Student",
                          "n": 0
                        },
                        {
                          "id": 1,
                          "text": "Instructor",
                          "n": 2
                        }
                      ]
                    },
                    {
                      "question": 2,
                      "qid": 2,
                      "type": "yesno",
                      "text": "Would you use a free Education Plan?",
                      "n": 0,
                      "yes": 0,
                      "no": 0
                    },
                    {
                      "question": 3,
                      "qid": 3,
                      "type": "yesno",
                      "text": "Would you teach your class with Mida?",
                      "n": 2,
                      "yes": 1,
                      "no": 1
                    }
                  ],
                  "written_answers": [],
                  "filters": [
                    {
                      "question": 1,
                      "is": 1
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/experiment/{test_id}/hypothesis": {
      "post": {
        "operationId": "linkHypothesisToExperiment",
        "summary": "Link Hypothesis to Experiment",
        "description": "Attach a hypothesis to an existing experiment, so its result reads against what it was meant to prove. Send hypothesis_id 0 to detach.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/link-hypothesis-to-experiment"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The experiment ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hypothesis_id": {
                    "type": "integer",
                    "description": "The hypothesis to attach. Send `0` or `null` to detach whatever is attached now"
                  }
                },
                "required": [
                  "hypothesis_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "test_id": 34707,
                  "test_name": "Pricing page mobile plan card",
                  "hypothesis_id": 4021,
                  "linked": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/events": {
      "get": {
        "operationId": "listEvents",
        "summary": "List Events",
        "description": "Return all custom events for the selected project. Only active, non-internal events are returned — mirrors the Events dashboard view.",
        "tags": [
          "Events"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/list-events"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": "50"
            },
            "description": "Max results to return. Maximum `500`."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": "0"
            },
            "description": "Number of records to skip (for pagination)."
          },
          {
            "name": "event_text",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "_(all)_"
            },
            "description": "Exact match filter on event name."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "_(all time)_"
            },
            "description": "Filter events on or after this date. Format: `YYYY-MM-DD`."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "_(all time)_"
            },
            "description": "Filter events on or before this date. Format: `YYYY-MM-DD`."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "company_id": 1001,
                  "count": 2,
                  "events": [
                    {
                      "event_id": 9876,
                      "event_text": "Pricing CTA Clicked",
                      "event_property": "{\"button_id\":\"hero-cta\"}",
                      "created_at": "2024-01-15T10:30:00.000Z"
                    },
                    {
                      "event_id": 9877,
                      "event_text": "Signup Started",
                      "event_property": null,
                      "created_at": "2024-01-15T10:35:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/experiments": {
      "get": {
        "operationId": "listExperiments",
        "summary": "List Experiments",
        "description": "Return all experiments for the company tied to the provided project key. Supports pagination.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/list-experiments"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": "50"
            },
            "description": "Max results to return. Maximum `500`."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": "0"
            },
            "description": "Number of records to skip (for pagination)."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "company_id": 1001,
                  "count": 2,
                  "experiments": [
                    {
                      "test_id": 1234,
                      "test_name": "Homepage CTA Button Color Test",
                      "url": "https://example.com/",
                      "status": 1,
                      "is_completed": 0,
                      "hypothesis_id": 4021,
                      "hypothesis": {
                        "hypothesis_id": 4021,
                        "problem": "The plan comparison is three screens tall on a phone.",
                        "solution": "Collapse the comparison into a single card with a plan switcher."
                      },
                      "created_at": "2024-01-15T10:30:00.000Z",
                      "updated_at": "2024-01-20T14:22:00.000Z"
                    },
                    {
                      "test_id": 1235,
                      "test_name": "Pricing Page Hero Copy Test",
                      "url": "https://example.com/pricing",
                      "status": 0,
                      "is_completed": 1,
                      "hypothesis_id": null,
                      "created_at": "2024-02-01T08:00:00.000Z",
                      "updated_at": "2024-03-01T09:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/goals": {
      "get": {
        "operationId": "listGoals",
        "summary": "List Goals",
        "description": "Return all goal profiles for the selected project. Goals define what counts as a conversion in your experiments.",
        "tags": [
          "Goals"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/list-goals"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": "50"
            },
            "description": "Max results to return. Maximum `500`."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": "0"
            },
            "description": "Number of records to skip (for pagination)."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "company_id": 1001,
                  "count": 2,
                  "goals": [
                    {
                      "goal_profile_id": 3003,
                      "goal_key": "cta_button_click",
                      "goal_name": "CTA Button Click",
                      "goal_type": "clickOnElement",
                      "goal_value": ".cta-button",
                      "goal_purpose": "sell",
                      "element_url": "https://example.com/"
                    },
                    {
                      "goal_profile_id": 3004,
                      "goal_key": "signup_page_view",
                      "goal_name": "Signup Page View",
                      "goal_type": "pageview",
                      "goal_value": "https://example.com/signup",
                      "goal_purpose": "sell",
                      "element_url": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/personalization/saved-accounts": {
      "get": {
        "operationId": "listSavedTargetAccounts",
        "summary": "List Saved Target Accounts",
        "description": "Companies this project has targeted before, most recently used first. An account already listed has been researched already, so reusing it is cheaper and starts warm.",
        "tags": [
          "Personalization"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/list-saved-target-accounts"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional filter on name, domain or industry"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/surveys": {
      "get": {
        "operationId": "listSurveys",
        "summary": "List Surveys",
        "description": "The project's on-site surveys, with how many people saw and answered each.",
        "tags": [
          "Surveys"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/list-surveys"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only surveys in this status: `draft`, `live`, `paused`, `ended` or `archived`"
          },
          {
            "name": "include_archived",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "`true` also lists archived surveys. They are left out otherwise"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "allowed": true,
                  "reason": "",
                  "surveys": [
                    {
                      "survey_id": 42,
                      "name": "Who is visiting",
                      "status": "live",
                      "questions": 3,
                      "trigger": "time",
                      "shown": 299,
                      "answered": 8,
                      "created_at": "2026-10-22T03:10:00.000Z",
                      "started_at": "2026-10-22T03:15:00.000Z",
                      "ended_at": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/account/members": {
      "get": {
        "operationId": "listTeamMembers",
        "summary": "List Team Members",
        "description": "Everyone on the account that owns this project, with their role, whether they can make changes, membership kind, status and last login. Read-only: roles are managed under Team settings in the dashboard.",
        "tags": [
          "Account"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/list-team-members"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "count": 3,
                  "members": [
                    {
                      "name": "Alicia",
                      "email": "alicia@example.com",
                      "role": 0,
                      "role_label": "Owner",
                      "can_edit": true,
                      "status": "active",
                      "membership": "direct",
                      "last_login_at": "2026-08-18T09:12:44.000Z"
                    },
                    {
                      "name": "Ethan",
                      "email": "ethan@example.com",
                      "role": 1,
                      "role_label": "Admin",
                      "can_edit": true,
                      "status": "active",
                      "membership": "invited member",
                      "last_login_at": "2026-08-19T02:03:10.000Z"
                    },
                    {
                      "name": "Sam",
                      "email": "sam@example.com",
                      "role": 3,
                      "role_label": "Viewer",
                      "can_edit": false,
                      "status": "invited",
                      "membership": "invited member",
                      "last_login_at": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/personalization/suggested-pages": {
      "get": {
        "operationId": "personalizationSuggestedPages",
        "summary": "Suggested Pages to Personalize",
        "description": "Which of your own pages are worth personalizing, ranked, with a reason each. Candidates come from your real traffic over the last 60 days, so these are pages that exist and get visited.",
        "tags": [
          "Personalization"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/personalization-suggested-pages"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional, repeatable. Company names to rank the pages for. The ranking is much sharper with them than without"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/experiment/{test_id}/serve-winner": {
      "post": {
        "operationId": "serveExperimentWinner",
        "summary": "Serve Experiment Winner",
        "description": "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.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/serve-experiment-winner"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric experiment ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "variant_id": {
                    "type": "string",
                    "description": "Winning variant id (e.g. `\"1\"` for Variant 1). Same id as in Get Experiment Result variant rows. Alias: `serving_variant_id`."
                  },
                  "traffic_allocation": {
                    "type": "number",
                    "description": "Rollout percentage `0`–`100` of **eligible** visitors who receive the winner (deterministic bucketing). Omit to keep the experiment's existing `traffic_allocation`."
                  }
                },
                "required": [
                  "variant_id"
                ]
              },
              "example": {
                "variant_id": "1"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "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."
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/experiment/{test_id}/stop-serving": {
      "post": {
        "operationId": "stopExperimentServing",
        "summary": "Stop Experiment Serving",
        "description": "Stop serving the winner at 100% on an experiment. Clears serving_variant_id so visitors are no longer forced to the winning variant.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/stop-experiment-serving"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric experiment ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "test_id": 1234,
                  "serving_variant_id": null,
                  "is_serving": false,
                  "message": "Serving stopped. Visitors are no longer forced to the winner variant."
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/experiment/{test_id}/status": {
      "patch": {
        "operationId": "updateExperimentStatus",
        "summary": "Update Experiment Status",
        "description": "Start, pause, or deactivate an experiment by updating its status. This is the primary way to control an experiment's lifecycle via the API.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/update-experiment-status"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric experiment ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "integer"
                  }
                }
              },
              "example": {
                "status": 1
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "test_id": 1234,
                  "status": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/experiment/{test_id}/serving-rollout": {
      "patch": {
        "operationId": "updateServingRollout",
        "summary": "Update Serving Rollout",
        "description": "Change the rollout percentage for an experiment that is already serving a winner. Updates traffic_allocation without changing which variant is served.",
        "tags": [
          "Experiments"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/update-serving-rollout"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your project's API key"
          },
          {
            "name": "test_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The numeric experiment ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "traffic_allocation": {
                    "type": "number",
                    "description": "Rollout percentage `0`–`100` of eligible visitors who receive the winning variant."
                  }
                },
                "required": [
                  "traffic_allocation"
                ]
              },
              "example": {
                "traffic_allocation": 50
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "test_id": 1234,
                  "traffic_allocation": 50,
                  "is_serving": true,
                  "message": "Serving rollout percentage updated."
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/v2/project/{project_key}/survey/{survey_id}/status": {
      "patch": {
        "operationId": "updateSurveyStatus",
        "summary": "Update Survey Status",
        "description": "Set a survey live, pause it, or end it.",
        "tags": [
          "Surveys"
        ],
        "externalDocs": {
          "url": "https://docs.mida.so/docs/v2/update-survey-status"
        },
        "parameters": [
          {
            "name": "project_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "survey_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "description": "`live`, `paused` or `ended`"
                  }
                },
                "required": [
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key generated in the Mida dashboard, sent as `Authorization: Bearer <key>`."
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "The same API key, sent as `x-api-key: <key>`."
      }
    }
  }
}
