---
title: "Create a native Fine Structure A/B test between existing app pages"
method: POST
path: "/api/mcp/tools/create_ab_test"
tags: ["tools"]
---

# Create a native Fine Structure A/B test between existing app pages

`POST /api/mcp/tools/create_ab_test`

## Request

- Base URL: `https://finestructure.ai`
- URL: `https://finestructure.ai/api/mcp/tools/create_ab_test`
- Auth: HTTP bearer

Create a native Fine Structure A/B test between existing app pages. Use update_app first if a variant page still needs to be generated. Creates a Saved Version before the change.

## Request body

- object
  - `app_id` string, required: The app ID
  - `name` string, required: Experiment name
  - `page_name` string, required: Base route page that triggers the experiment
  - `variants` object[], required: At least two variants. Traffic must total 100.
    - `page_name` string, required: Existing app page name or path
    - `traffic_percent` integer, required: Traffic percentage for this variant
  - `goal_event_type` string: Optional conversion goal type: entity_create, any, form_submit
  - `goal_event_filter` object: Optional goal filter, for example {'entity_name': 'Lead'}
  - `is_active` boolean: Whether to activate the test immediately

## Response `200`

Tool executed successfully

- ToolResult
  - `ok` boolean, required
  - `tool` string, required
  - `result` object, required

## Other responses

- `400`: Invalid arguments for this tool
- `401`: Missing or invalid bearer token
- `402`: Not enough credits on the account
- `403`: Token scope does not permit this tool
- `404`: Unknown tool name
- `429`: Rate limit exceeded, retry after the indicated delay
- `500`: Internal error while executing the tool

---

[API](https://skmtc.dev/finestructure/apis/fine-structure-api.md) · [All operations](https://skmtc.dev/finestructure/apis/fine-structure-api/llms.txt) · [OpenAPI document](https://skmtc.dev/finestructure/apis/fine-structure-api/revisions/02c50ed5fd70?raw)
