Skip to content

Create A/B test

POST
/api/v1/gtm/ab-tests
curl --request POST \
--url https://api.ultimateteam.ai/api/v1/gtm/ab-tests \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "campaign_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "hypothesis": "example", "metric_name": "example", "min_observations": 100, "name": "example", "split_ratio": {}, "variants": [ { "config": {}, "name": "example" } ] }'

Create a new A/B test.

Media typeapplication/json
ABTestCreate

Request body for creating an A/B test.

object
campaign_id
Any of:
string format: uuid
hypothesis
required
Hypothesis
string
>= 1 characters
metric_name
required
Metric Name
string
>= 1 characters <= 100 characters
min_observations
Min Observations
integer
default: 100 >= 10
name
required
Name
string
>= 1 characters <= 255 characters
split_ratio
Split Ratio
object
key
additional properties
any
variants
Any of:
Array<object>
VariantCreate

Request body for creating a test variant.

object
config
Config
object
key
additional properties
any
name
required
Name
string
>= 1 characters <= 100 characters

Successful Response

Media typeapplication/json
ABTestResponse

Response body for a single A/B test.

object
campaign_id
Any of:
string format: uuid
concluded_at
Any of:
string format: date-time
created_at
required
Created At
string format: date-time
hypothesis
required
Hypothesis
string
id
required
Id
string format: uuid
metric_name
required
Metric Name
string
min_observations
required
Min Observations
integer
name
required
Name
string
significance_threshold
required
Significance Threshold
number
split_ratio
required
Split Ratio
object
key
additional properties
any
status
required
Status
string
tenant_id
required
Tenant Id
string format: uuid
variants
Variants
Array<object>
VariantResponse

Response body for a single variant.

object
config
required
Config
object
key
additional properties
any
created_at
required
Created At
string format: date-time
id
required
Id
string format: uuid
name
required
Name
string
observations
required
Observations
integer
successes
required
Successes
integer
test_id
required
Test Id
string format: uuid
winner_variant
Any of:
string
Examplegenerated
{
"campaign_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"concluded_at": "2026-04-15T12:00:00Z",
"created_at": "2026-04-15T12:00:00Z",
"hypothesis": "example",
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"metric_name": "example",
"min_observations": 1,
"name": "example",
"significance_threshold": 1,
"split_ratio": {},
"status": "example",
"tenant_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"variants": [
{
"config": {},
"created_at": "2026-04-15T12:00:00Z",
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"name": "example",
"observations": 1,
"successes": 1,
"test_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}
],
"winner_variant": "example"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}