REST API
A versioned JSON API for server-to-server use. This reference is generated from the OpenAPI specification.
Base URL
https://app.splittesty.com/api/v1Authentication
Create a token under Settings → API tokens and send it as a bearer token. A token is bound to one workspace. Scopes are hierarchical — publish includes edit, edit includes browse — and a token can never do more than the current role of the user who created it.
curl "https://app.splittesty.com/api/v1/workspaces" \
-H "Authorization: Bearer $SPT_API_TOKEN"Rate limits
120 requests per minute and token. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset; a 429 response also carries Retry-After in seconds.
Pagination
List endpoints return data, next_cursor and has_more. Pass next_cursor unchanged as cursor to read the next page; limit may be 1–100 (default 25).
Errors
Errors use a matching HTTP status and a JSON envelope with a stable code and a readable message.
{
"error": {
"code": "not_found",
"message": "Campaign not found."
}
}| Code | HTTP status | Meaning |
|---|---|---|
unauthenticated | 401 | The token is missing, unknown, expired or revoked. |
forbidden | 403 | The token’s scope or its owner’s role does not allow the action. |
not_found | 404 | The resource does not exist in the token’s workspace. |
invalid_request | 400 | Malformed JSON, unknown property or failed validation. |
conflict | 409 | The current state does not allow the change. |
confirm_running | 409 | The campaign is running; repeat with confirm_running: true. |
not_ready | 422 | The campaign fails the launch checks (see details.problems). |
rate_limited | 429 | Too many requests; wait Retry-After seconds. |
Changing running campaigns
Changing what visitors experience while a campaign is running can mix data collected under different settings. Such requests fail with confirm_running unless you send confirm_running: true. Cloning the campaign is usually the better choice.
Endpoints
Workspaces
The workspace a token belongs to.
get/workspacesGet the token's workspace
Scope: browse
Returns a list with exactly one entry: the workspace the token is bound to.
Responses
200The workspace.→ object401Missing, invalid, expired or revoked token.403The token lacks the required scope, or its owner's role no longer allows the action.429Rate limit exceeded.
Example request
curl "https://app.splittesty.com/api/v1/workspaces" \
-H "Authorization: Bearer $SPT_API_TOKEN"Campaigns
Experiments, rollouts and personalizations.
get/campaignsList campaigns
Scope: browse
Newest first.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | Page size (1–100). |
cursor | query | string | next_cursor of the previous page. |
status | query | "draft" | "qa" | "scheduled" | "running" | "paused" | "archived" | Only campaigns in this status. |
type | query | "ab" | "multipage" | "split" | "mvt" | "rollout" | "personalization" | Only campaigns of this type. |
Responses
200A page of campaigns.→ object400The request is malformed or fails validation.401Missing, invalid, expired or revoked token.403The token lacks the required scope, or its owner's role no longer allows the action.429Rate limit exceeded.
Example request
curl "https://app.splittesty.com/api/v1/campaigns?limit=10" \
-H "Authorization: Bearer $SPT_API_TOKEN"Example response
{
"data": [
{
"id": 42,
"name": "Pricing page headline",
"type": "ab",
"status": "draft",
"url": "https://www.example.com/pricing",
"notes": null,
"traffic": 100,
"traffic_split": "equal",
"created_at": "2026-03-02T09:15:00.000Z",
"updated_at": "2026-03-02T09:15:00.000Z",
"started_at": null,
"stopped_at": null,
"result": null
}
],
"next_cursor": null,
"has_more": false
}post/campaignsCreate a campaign
Scope: edit
Creates a draft. Tests start with a control and one variation; when a URL is given it becomes the first page rule.
Request body
| Field | Type | Description |
|---|---|---|
name(required) | string | |
type | "ab" | "multipage" | "split" | "mvt" | "rollout" | "personalization" | |
url | string | http(s) URL of the page under test. |
Responses
201The created campaign.→ CampaignDetail400The request is malformed or fails validation.401Missing, invalid, expired or revoked token.403The token lacks the required scope, or its owner's role no longer allows the action.429Rate limit exceeded.
Example request
curl -X POST "https://app.splittesty.com/api/v1/campaigns" \
-H "Authorization: Bearer $SPT_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Pricing page headline",
"type": "ab",
"url": "https://www.example.com/pricing"
}'get/campaigns/{id}Get a campaign
Scope: browse
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id(required) | path | integer | Numeric campaign id as shown in the dashboard. |
Responses
200The campaign with its pages, variations and metrics.→ CampaignDetail401Missing, invalid, expired or revoked token.403The token lacks the required scope, or its owner's role no longer allows the action.404The resource does not exist in the token's workspace.429Rate limit exceeded.
Example request
curl "https://app.splittesty.com/api/v1/campaigns/42" \
-H "Authorization: Bearer $SPT_API_TOKEN"patch/campaigns/{id}Update a campaign
Scope: edit
Partial update. name, notes and stats can always be changed; everything else on a running campaign needs confirm_running: true (409 confirm_running otherwise). Archived campaigns are read-only.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id(required) | path | integer | Numeric campaign id as shown in the dashboard. |
Request body
| Field | Type | Description |
|---|---|---|
name | string | |
notes | string | |
url | string | http(s) URL; an empty string clears it. |
traffic | number | |
segment | object | null | Condition tree, or null for all visitors. |
trigger | object | |
stats | StatsConfig | |
confirm_running | boolean | Required (true) when the change affects a RUNNING campaign. Changing a live test can mix data collected under different settings — consider cloning instead. |
Responses
200The updated campaign.→ CampaignDetail400The request is malformed or fails validation.401Missing, invalid, expired or revoked token.403The token lacks the required scope, or its owner's role no longer allows the action.404The resource does not exist in the token's workspace.409The current state does not allow the change (code conflict), or a running campaign needs confirm_running (code confirm_running).429Rate limit exceeded.
Example request
curl -X PATCH "https://app.splittesty.com/api/v1/campaigns/42" \
-H "Authorization: Bearer $SPT_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Pricing headline v2",
"traffic": 50
}'delete/campaigns/{id}Delete a campaign
Scope: edit
Permanently deletes the campaign and its data. As in the dashboard this is an admin action: besides the edit scope, the token's owner must currently be an admin or owner. Running campaigns must be paused first.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id(required) | path | integer | Numeric campaign id as shown in the dashboard. |
Responses
204Deleted.401Missing, invalid, expired or revoked token.403The token lacks the required scope, or its owner's role no longer allows the action.404The resource does not exist in the token's workspace.409The current state does not allow the change (code conflict), or a running campaign needs confirm_running (code confirm_running).429Rate limit exceeded.
Example request
curl -X DELETE "https://app.splittesty.com/api/v1/campaigns/42" \
-H "Authorization: Bearer $SPT_API_TOKEN"post/campaigns/{id}/statusStart, pause or archive a campaign
Scope: publish
start → running (runs the launch checks; 422 not_ready lists what is missing), pause → paused, archive → archived. Emits the campaign.status_changed webhook.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id(required) | path | integer | Numeric campaign id as shown in the dashboard. |
Request body
| Field | Type | Description |
|---|---|---|
action(required) | "start" | "pause" | "archive" |
Responses
200The campaign in its new status.→ Campaign400The request is malformed or fails validation.401Missing, invalid, expired or revoked token.403The token lacks the required scope, or its owner's role no longer allows the action.404The resource does not exist in the token's workspace.409The current state does not allow the change (code conflict), or a running campaign needs confirm_running (code confirm_running).422The campaign fails the launch checks.429Rate limit exceeded.
Example request
curl -X POST "https://app.splittesty.com/api/v1/campaigns/42/status" \
-H "Authorization: Bearer $SPT_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "start"
}'Variations
The arms of a campaign.
get/campaigns/{id}/variationsList variations
Scope: browse
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id(required) | path | integer | Numeric campaign id as shown in the dashboard. |
Responses
200All variations of the campaign (never paginated; at most 20).→ object401Missing, invalid, expired or revoked token.403The token lacks the required scope, or its owner's role no longer allows the action.404The resource does not exist in the token's workspace.429Rate limit exceeded.
Example request
curl "https://app.splittesty.com/api/v1/campaigns/42/variations" \
-H "Authorization: Bearer $SPT_API_TOKEN"Example response
{
"data": [
{
"key": "v1",
"name": "Variation 1",
"is_control": false,
"weight": 50,
"disabled": false,
"redirect_url": null,
"changes": [
{
"page": null,
"ops": [],
"js": null,
"css": null
}
]
}
],
"next_cursor": null,
"has_more": false
}post/campaigns/{id}/variationsAdd a variation
Scope: edit
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id(required) | path | integer | Numeric campaign id as shown in the dashboard. |
Request body
| Field | Type | Description |
|---|---|---|
name | string | |
confirm_running | boolean | Required (true) when the change affects a RUNNING campaign. Changing a live test can mix data collected under different settings — consider cloning instead. |
Responses
201The created variation.→ Variation400The request is malformed or fails validation.401Missing, invalid, expired or revoked token.403The token lacks the required scope, or its owner's role no longer allows the action.404The resource does not exist in the token's workspace.409The current state does not allow the change (code conflict), or a running campaign needs confirm_running (code confirm_running).429Rate limit exceeded.
Example request
curl -X POST "https://app.splittesty.com/api/v1/campaigns/42/variations" \
-H "Authorization: Bearer $SPT_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Shorter headline"
}'Example response
{
"key": "v1",
"name": "Variation 1",
"is_control": false,
"weight": 50,
"disabled": false,
"redirect_url": null,
"changes": [
{
"page": null,
"ops": [],
"js": null,
"css": null
}
]
}patch/campaigns/{id}/variations/{key}Update a variation
Scope: edit
Renaming is always allowed; other changes on a running campaign need confirm_running: true.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id(required) | path | integer | Numeric campaign id as shown in the dashboard. |
key(required) | path | string | Stable key of the variation, e.g. v1. |
Request body
| Field | Type | Description |
|---|---|---|
name | string | |
weight | number | |
disabled | boolean | The control cannot be disabled. |
redirect_url | string | Split URL destination; an empty string clears it. |
changes | ChangeSet[] | Replaces all change sets of the variation. |
confirm_running | boolean | Required (true) when the change affects a RUNNING campaign. Changing a live test can mix data collected under different settings — consider cloning instead. |
Responses
200The updated variation.→ Variation400The request is malformed or fails validation.401Missing, invalid, expired or revoked token.403The token lacks the required scope, or its owner's role no longer allows the action.404The resource does not exist in the token's workspace.409The current state does not allow the change (code conflict), or a running campaign needs confirm_running (code confirm_running).429Rate limit exceeded.
Example request
curl -X PATCH "https://app.splittesty.com/api/v1/campaigns/42/variations/v1" \
-H "Authorization: Bearer $SPT_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"weight": 30,
"changes": [
{
"ops": [
{
"id": "op1",
"type": "setText",
"selector": "h1",
"payload": {
"text": "Grow faster"
}
}
]
}
]
}'delete/campaigns/{id}/variations/{key}Delete a variation
Scope: edit
Only possible before the campaign has collected data; afterwards disable the variation instead. The control cannot be deleted.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id(required) | path | integer | Numeric campaign id as shown in the dashboard. |
key(required) | path | string | Stable key of the variation, e.g. v1. |
confirm_running | query | "true" | "false" | Set to true to confirm the change on a running campaign. |
Responses
204Deleted.400The request is malformed or fails validation.401Missing, invalid, expired or revoked token.403The token lacks the required scope, or its owner's role no longer allows the action.404The resource does not exist in the token's workspace.409The current state does not allow the change (code conflict), or a running campaign needs confirm_running (code confirm_running).429Rate limit exceeded.
Example request
curl -X DELETE "https://app.splittesty.com/api/v1/campaigns/42/variations/v1" \
-H "Authorization: Bearer $SPT_API_TOKEN"Metrics
Reusable goals.
get/metricsList metrics
Scope: browse
Newest first.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | Page size (1–100). |
cursor | query | string | next_cursor of the previous page. |
include_archived | query | "true" | "false" | Include archived metrics. |
Responses
200A page of metrics.→ object400The request is malformed or fails validation.401Missing, invalid, expired or revoked token.403The token lacks the required scope, or its owner's role no longer allows the action.429Rate limit exceeded.
Example request
curl "https://app.splittesty.com/api/v1/metrics?limit=10" \
-H "Authorization: Bearer $SPT_API_TOKEN"post/metricsCreate a metric
Scope: edit
The required fields depend on the type: click / formSubmit / elementVisible need selector; pageView / linkClick need url; custom needs event; timeOnPage / scrollDepth need threshold; sum and average need a revenue or custom event.
Request body
| Field | Type | Description |
|---|---|---|
name(required) | string | |
description | string | |
type(required) | "pageView" | "click" | "formSubmit" | "linkClick" | "custom" | "revenue" | "timeOnPage" | "scrollDepth" | "elementVisible" | |
aggregation | "uniqueVisitors" | "totalConversions" | "sum" | "average" | |
direction | "increase" | "decrease" | |
category | string | |
selector | string | CSS selector (click, formSubmit, elementVisible). |
url | UrlRule | |
event | string | Event name passed to track() (custom, revenue). |
property | string | Numeric property summed / averaged. |
threshold | number | Seconds (timeOnPage) or percent (scrollDepth). |
Responses
201The created metric.→ Metric400The request is malformed or fails validation.401Missing, invalid, expired or revoked token.403The token lacks the required scope, or its owner's role no longer allows the action.429Rate limit exceeded.
Example request
curl -X POST "https://app.splittesty.com/api/v1/metrics" \
-H "Authorization: Bearer $SPT_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Signup click",
"type": "click",
"selector": "#signup",
"category": "conversion"
}'Example response
{
"key": "m_3f9a1c20be",
"name": "Signup click",
"description": null,
"type": "click",
"aggregation": "uniqueVisitors",
"direction": "increase",
"category": "conversion",
"selector": "#signup",
"url": null,
"event": null,
"property": null,
"threshold": null,
"archived": false,
"created_at": "2026-03-02T09:15:00.000Z",
"used_in": 0
}get/metrics/{key}Get a metric
Scope: browse
Parameters
| Name | In | Type | Description |
|---|---|---|---|
key(required) | path | string | Stable key of the metric, e.g. m_revenue. |
Responses
200The metric.→ Metric401Missing, invalid, expired or revoked token.403The token lacks the required scope, or its owner's role no longer allows the action.404The resource does not exist in the token's workspace.429Rate limit exceeded.
Example request
curl "https://app.splittesty.com/api/v1/metrics/signup" \
-H "Authorization: Bearer $SPT_API_TOKEN"Example response
{
"key": "m_3f9a1c20be",
"name": "Signup click",
"description": null,
"type": "click",
"aggregation": "uniqueVisitors",
"direction": "increase",
"category": "conversion",
"selector": "#signup",
"url": null,
"event": null,
"property": null,
"threshold": null,
"archived": false,
"created_at": "2026-03-02T09:15:00.000Z",
"used_in": 0
}Reports
Collected data per metric and variation.
get/campaigns/{id}/reportGet report data
Scope: browse
Totals per metric and variation. stats holds the statistics computed by the dashboard report for the same date range when they have been computed already, otherwise null.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id(required) | path | integer | Numeric campaign id as shown in the dashboard. |
from | query | string (date) | First day (UTC), inclusive. |
to | query | string (date) | Last day (UTC), inclusive. |
Responses
200The report.→ Report400The request is malformed or fails validation.401Missing, invalid, expired or revoked token.403The token lacks the required scope, or its owner's role no longer allows the action.404The resource does not exist in the token's workspace.429Rate limit exceeded.
Example request
curl "https://app.splittesty.com/api/v1/campaigns/42/report" \
-H "Authorization: Bearer $SPT_API_TOKEN"Schemas
Error
| Field | Type | Description |
|---|---|---|
error(required) | object |
Workspace
| Field | Type | Description |
|---|---|---|
account_id(required) | integer | Public account id used in the install snippet. |
name(required) | string | |
organization | string | null | |
timezone | string | |
data_region | string | null | |
require_consent | boolean | Whether tracking waits for visitor consent. |
retention_days | integer | |
created_at | string (date-time) | |
token | object | The token used for this request. |
Campaign
| Field | Type | Description |
|---|---|---|
id(required) | integer | Numeric id, unique within the workspace. |
name(required) | string | |
type(required) | "ab" | "multipage" | "split" | "mvt" | "rollout" | "personalization" | |
status(required) | "draft" | "qa" | "scheduled" | "running" | "paused" | "archived" | |
url | string | null | Primary URL of the campaign. |
notes | string | null | |
traffic | number | Share of visitors included in the campaign, 0–100. |
traffic_split | "equal" | "custom" | |
created_at | string (date-time) | |
updated_at | string (date-time) | |
started_at | string (date-time) | null | |
stopped_at | string (date-time) | null | |
result | object | null | Latest result summary, once a report has been computed. |
CampaignDetail
A Campaign plus its configuration.
| Field | Type | Description |
|---|---|---|
id(required) | integer | |
name(required) | string | |
type(required) | "ab" | "multipage" | "split" | "mvt" | "rollout" | "personalization" | |
status(required) | "draft" | "qa" | "scheduled" | "running" | "paused" | "archived" | |
url | string | null | |
notes | string | null | |
traffic | number | |
traffic_split | "equal" | "custom" | |
created_at | string (date-time) | |
updated_at | string (date-time) | |
started_at | string (date-time) | null | |
stopped_at | string (date-time) | null | |
result | object | null | |
segment | object | null | Audience condition tree; null targets all visitors. |
trigger | object | null | When the campaign activates, e.g. { "type": "pageView" }. |
stats | StatsConfig | |
pages(required) | object[] | |
variations(required) | Variation[] | |
metrics(required) | object[] |
CampaignCreate
| Field | Type | Description |
|---|---|---|
name(required) | string | |
type | "ab" | "multipage" | "split" | "mvt" | "rollout" | "personalization" | |
url | string | http(s) URL of the page under test. |
CampaignUpdate
| Field | Type | Description |
|---|---|---|
name | string | |
notes | string | |
url | string | http(s) URL; an empty string clears it. |
traffic | number | |
segment | object | null | Condition tree, or null for all visitors. |
trigger | object | |
stats | StatsConfig | |
confirm_running | boolean | Required (true) when the change affects a RUNNING campaign. Changing a live test can mix data collected under different settings — consider cloning instead. |
CampaignStatusChange
| Field | Type | Description |
|---|---|---|
action(required) | "start" | "pause" | "archive" |
StatsConfig
| Field | Type | Description |
|---|---|---|
approach(required) | "sequential" | "fixed" | |
correction(required) | "none" | "bonferroni" | "sidak" | |
winnerThreshold(required) | number | Probability needed to call a winner, e.g. 0.95. |
mde(required) | number | Minimum detectable effect (relative), e.g. 0.05. |
rope(required) | number | Region of practical equivalence (relative half-width). |
power(required) | number |
UrlRule
| Field | Type | Description |
|---|---|---|
type(required) | "wildcard" | "exact" | "contains" | "startsWith" | "endsWith" | "regex" | |
value(required) | string |
Variation
| Field | Type | Description |
|---|---|---|
key(required) | string | Stable key used in events and reports ("v0" is the control). |
name(required) | string | |
is_control(required) | boolean | |
weight(required) | number | Traffic share in percent (used with a custom split). |
disabled(required) | boolean | |
redirect_url | string | null | Split URL destination. |
changes | ChangeSet[] |
ChangeSet
| Field | Type | Description |
|---|---|---|
page | integer | null | Index of the page group (multi-page tests); null applies everywhere. |
ops | object[] | Visual editor operations: { id, type, selector, payload }. |
js | string | null | |
css | string | null |
VariationCreate
| Field | Type | Description |
|---|---|---|
name | string | |
confirm_running | boolean | Required (true) when the change affects a RUNNING campaign. Changing a live test can mix data collected under different settings — consider cloning instead. |
VariationUpdate
| Field | Type | Description |
|---|---|---|
name | string | |
weight | number | |
disabled | boolean | The control cannot be disabled. |
redirect_url | string | Split URL destination; an empty string clears it. |
changes | ChangeSet[] | Replaces all change sets of the variation. |
confirm_running | boolean | Required (true) when the change affects a RUNNING campaign. Changing a live test can mix data collected under different settings — consider cloning instead. |
Metric
| Field | Type | Description |
|---|---|---|
key(required) | string | Stable key used in events and reports. |
name(required) | string | |
description | string | null | |
type(required) | "pageView" | "click" | "formSubmit" | "linkClick" | "custom" | "revenue" | "timeOnPage" | "scrollDepth" | "elementVisible" | |
aggregation(required) | "uniqueVisitors" | "totalConversions" | "sum" | "average" | |
direction(required) | "increase" | "decrease" | Whether a higher value is better. |
category | string | null | |
selector | string | null | |
url | UrlRule | null | |
event | string | null | |
property | string | null | |
threshold | number | null | |
archived | boolean | |
created_at | string (date-time) | |
used_in | integer | Number of campaigns using the metric (single-metric responses only). |
MetricCreate
| Field | Type | Description |
|---|---|---|
name(required) | string | |
description | string | |
type(required) | "pageView" | "click" | "formSubmit" | "linkClick" | "custom" | "revenue" | "timeOnPage" | "scrollDepth" | "elementVisible" | |
aggregation | "uniqueVisitors" | "totalConversions" | "sum" | "average" | |
direction | "increase" | "decrease" | |
category | string | |
selector | string | CSS selector (click, formSubmit, elementVisible). |
url | UrlRule | |
event | string | Event name passed to track() (custom, revenue). |
property | string | Numeric property summed / averaged. |
threshold | number | Seconds (timeOnPage) or percent (scrollDepth). |
Report
| Field | Type | Description |
|---|---|---|
campaign(required) | object | |
from | string (date) | null | |
to | string (date) | null | |
variations(required) | object[] | |
metrics(required) | object[] | |
stats | object | null | Statistics from the dashboard report (probabilities, intervals, decision) when cached for the same range. |