Skip to content

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/v1
Download OpenAPI 3.1 (JSON)

Authentication

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."
  }
}
Errors
CodeHTTP statusMeaning
unauthenticated401The token is missing, unknown, expired or revoked.
forbidden403The token’s scope or its owner’s role does not allow the action.
not_found404The resource does not exist in the token’s workspace.
invalid_request400Malformed JSON, unknown property or failed validation.
conflict409The current state does not allow the change.
confirm_running409The campaign is running; repeat with confirm_running: true.
not_ready422The campaign fails the launch checks (see details.problems).
rate_limited429Too 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.→ object
  • 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/workspaces" \
  -H "Authorization: Bearer $SPT_API_TOKEN"

Campaigns

Experiments, rollouts and personalizations.

get/campaignsList campaigns

Scope: browse

Newest first.

Parameters
Parameters
NameInTypeDescription
limitqueryintegerPage size (1–100).
cursorquerystringnext_cursor of the previous page.
statusquery"draft" | "qa" | "scheduled" | "running" | "paused" | "archived"Only campaigns in this status.
typequery"ab" | "multipage" | "split" | "mvt" | "rollout" | "personalization"Only campaigns of this type.
Responses
  • 200A page of campaigns.→ object
  • 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.
  • 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
Request body
FieldTypeDescription
name(required)string
type"ab" | "multipage" | "split" | "mvt" | "rollout" | "personalization"
urlstringhttp(s) URL of the page under test.
Responses
  • 201The created campaign.→ CampaignDetail
  • 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.
  • 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
Parameters
NameInTypeDescription
id(required)pathintegerNumeric campaign id as shown in the dashboard.
Responses
  • 200The campaign with its pages, variations and metrics.→ CampaignDetail
  • 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" \
  -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
Parameters
NameInTypeDescription
id(required)pathintegerNumeric campaign id as shown in the dashboard.
Request body
Request body
FieldTypeDescription
namestring
notesstring
urlstringhttp(s) URL; an empty string clears it.
trafficnumber
segmentobject | nullCondition tree, or null for all visitors.
triggerobject
statsStatsConfig
confirm_runningbooleanRequired (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.→ CampaignDetail
  • 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 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
Parameters
NameInTypeDescription
id(required)pathintegerNumeric 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
Parameters
NameInTypeDescription
id(required)pathintegerNumeric campaign id as shown in the dashboard.
Request body
Request body
FieldTypeDescription
action(required)"start" | "pause" | "archive"
Responses
  • 200The campaign in its new status.→ Campaign
  • 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).
  • 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
Parameters
NameInTypeDescription
id(required)pathintegerNumeric campaign id as shown in the dashboard.
Responses
  • 200All variations of the campaign (never paginated; at most 20).→ object
  • 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/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
Parameters
NameInTypeDescription
id(required)pathintegerNumeric campaign id as shown in the dashboard.
Request body
Request body
FieldTypeDescription
namestring
confirm_runningbooleanRequired (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.→ Variation
  • 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 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
Parameters
NameInTypeDescription
id(required)pathintegerNumeric campaign id as shown in the dashboard.
key(required)pathstringStable key of the variation, e.g. v1.
Request body
Request body
FieldTypeDescription
namestring
weightnumber
disabledbooleanThe control cannot be disabled.
redirect_urlstringSplit URL destination; an empty string clears it.
changesChangeSet[]Replaces all change sets of the variation.
confirm_runningbooleanRequired (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.→ Variation
  • 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 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
Parameters
NameInTypeDescription
id(required)pathintegerNumeric campaign id as shown in the dashboard.
key(required)pathstringStable key of the variation, e.g. v1.
confirm_runningquery"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
Parameters
NameInTypeDescription
limitqueryintegerPage size (1–100).
cursorquerystringnext_cursor of the previous page.
include_archivedquery"true" | "false"Include archived metrics.
Responses
  • 200A page of metrics.→ object
  • 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.
  • 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
Request body
FieldTypeDescription
name(required)string
descriptionstring
type(required)"pageView" | "click" | "formSubmit" | "linkClick" | "custom" | "revenue" | "timeOnPage" | "scrollDepth" | "elementVisible"
aggregation"uniqueVisitors" | "totalConversions" | "sum" | "average"
direction"increase" | "decrease"
categorystring
selectorstringCSS selector (click, formSubmit, elementVisible).
urlUrlRule
eventstringEvent name passed to track() (custom, revenue).
propertystringNumeric property summed / averaged.
thresholdnumberSeconds (timeOnPage) or percent (scrollDepth).
Responses
  • 201The created metric.→ Metric
  • 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.
  • 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
Parameters
NameInTypeDescription
key(required)pathstringStable key of the metric, e.g. m_revenue.
Responses
  • 200The metric.→ Metric
  • 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/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
Parameters
NameInTypeDescription
id(required)pathintegerNumeric campaign id as shown in the dashboard.
fromquerystring (date)First day (UTC), inclusive.
toquerystring (date)Last day (UTC), inclusive.
Responses
  • 200The report.→ Report
  • 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.
  • 429Rate limit exceeded.
Example request
curl "https://app.splittesty.com/api/v1/campaigns/42/report" \
  -H "Authorization: Bearer $SPT_API_TOKEN"

Schemas

Error

Error
FieldTypeDescription
error(required)object

Workspace

Workspace
FieldTypeDescription
account_id(required)integerPublic account id used in the install snippet.
name(required)string
organizationstring | null
timezonestring
data_regionstring | null
require_consentbooleanWhether tracking waits for visitor consent.
retention_daysinteger
created_atstring (date-time)
tokenobjectThe token used for this request.

Campaign

Campaign
FieldTypeDescription
id(required)integerNumeric id, unique within the workspace.
name(required)string
type(required)"ab" | "multipage" | "split" | "mvt" | "rollout" | "personalization"
status(required)"draft" | "qa" | "scheduled" | "running" | "paused" | "archived"
urlstring | nullPrimary URL of the campaign.
notesstring | null
trafficnumberShare of visitors included in the campaign, 0–100.
traffic_split"equal" | "custom"
created_atstring (date-time)
updated_atstring (date-time)
started_atstring (date-time) | null
stopped_atstring (date-time) | null
resultobject | nullLatest result summary, once a report has been computed.

CampaignDetail

A Campaign plus its configuration.

CampaignDetail
FieldTypeDescription
id(required)integer
name(required)string
type(required)"ab" | "multipage" | "split" | "mvt" | "rollout" | "personalization"
status(required)"draft" | "qa" | "scheduled" | "running" | "paused" | "archived"
urlstring | null
notesstring | null
trafficnumber
traffic_split"equal" | "custom"
created_atstring (date-time)
updated_atstring (date-time)
started_atstring (date-time) | null
stopped_atstring (date-time) | null
resultobject | null
segmentobject | nullAudience condition tree; null targets all visitors.
triggerobject | nullWhen the campaign activates, e.g. { "type": "pageView" }.
statsStatsConfig
pages(required)object[]
variations(required)Variation[]
metrics(required)object[]

CampaignCreate

CampaignCreate
FieldTypeDescription
name(required)string
type"ab" | "multipage" | "split" | "mvt" | "rollout" | "personalization"
urlstringhttp(s) URL of the page under test.

CampaignUpdate

CampaignUpdate
FieldTypeDescription
namestring
notesstring
urlstringhttp(s) URL; an empty string clears it.
trafficnumber
segmentobject | nullCondition tree, or null for all visitors.
triggerobject
statsStatsConfig
confirm_runningbooleanRequired (true) when the change affects a RUNNING campaign. Changing a live test can mix data collected under different settings — consider cloning instead.

CampaignStatusChange

CampaignStatusChange
FieldTypeDescription
action(required)"start" | "pause" | "archive"

StatsConfig

StatsConfig
FieldTypeDescription
approach(required)"sequential" | "fixed"
correction(required)"none" | "bonferroni" | "sidak"
winnerThreshold(required)numberProbability needed to call a winner, e.g. 0.95.
mde(required)numberMinimum detectable effect (relative), e.g. 0.05.
rope(required)numberRegion of practical equivalence (relative half-width).
power(required)number

UrlRule

UrlRule
FieldTypeDescription
type(required)"wildcard" | "exact" | "contains" | "startsWith" | "endsWith" | "regex"
value(required)string

Variation

Variation
FieldTypeDescription
key(required)stringStable key used in events and reports ("v0" is the control).
name(required)string
is_control(required)boolean
weight(required)numberTraffic share in percent (used with a custom split).
disabled(required)boolean
redirect_urlstring | nullSplit URL destination.
changesChangeSet[]

ChangeSet

ChangeSet
FieldTypeDescription
pageinteger | nullIndex of the page group (multi-page tests); null applies everywhere.
opsobject[]Visual editor operations: { id, type, selector, payload }.
jsstring | null
cssstring | null

VariationCreate

VariationCreate
FieldTypeDescription
namestring
confirm_runningbooleanRequired (true) when the change affects a RUNNING campaign. Changing a live test can mix data collected under different settings — consider cloning instead.

VariationUpdate

VariationUpdate
FieldTypeDescription
namestring
weightnumber
disabledbooleanThe control cannot be disabled.
redirect_urlstringSplit URL destination; an empty string clears it.
changesChangeSet[]Replaces all change sets of the variation.
confirm_runningbooleanRequired (true) when the change affects a RUNNING campaign. Changing a live test can mix data collected under different settings — consider cloning instead.

Metric

Metric
FieldTypeDescription
key(required)stringStable key used in events and reports.
name(required)string
descriptionstring | 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.
categorystring | null
selectorstring | null
urlUrlRule | null
eventstring | null
propertystring | null
thresholdnumber | null
archivedboolean
created_atstring (date-time)
used_inintegerNumber of campaigns using the metric (single-metric responses only).

MetricCreate

MetricCreate
FieldTypeDescription
name(required)string
descriptionstring
type(required)"pageView" | "click" | "formSubmit" | "linkClick" | "custom" | "revenue" | "timeOnPage" | "scrollDepth" | "elementVisible"
aggregation"uniqueVisitors" | "totalConversions" | "sum" | "average"
direction"increase" | "decrease"
categorystring
selectorstringCSS selector (click, formSubmit, elementVisible).
urlUrlRule
eventstringEvent name passed to track() (custom, revenue).
propertystringNumeric property summed / averaged.
thresholdnumberSeconds (timeOnPage) or percent (scrollDepth).

Report

Report
FieldTypeDescription
campaign(required)object
fromstring (date) | null
tostring (date) | null
variations(required)object[]
metrics(required)object[]
statsobject | nullStatistics from the dashboard report (probabilities, intervals, decision) when cached for the same range.