Path parameters
-
The ID of the team that the variant belongs to.
-
The experiment key that the variants belong to.
-
The variant key to show.
Body
-
key string
The key to use for the variant. Must not be greater than 255 characters.
-
control boolean
Whether the variant is the control.
-
description string
The description of the variant.
-
traffic string
The amount of traffic the variant should receive. This is only needed if the experiment is using Weighted Variants.
PUT /api/teams/{team}/experiments/{experiment}/variants/{variant}
curl \
-X PUT https://checkmango.com/api/teams/11/experiments/magni/variants/odit \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"key":"VARIANT_A","control":false,"description":"Dolores ullam nihil inventore aspernatur dolores eveniet.","traffic":50}'
Request example
{
"key": "VARIANT_A",
"control": false,
"description": "Dolores ullam nihil inventore aspernatur dolores eveniet.",
"traffic": 50
}
Response examples (200)
{
"data": {
"id": "VOLUPTAS_PROVIDENT_EST_RATIONE_QUO",
"type": "variants",
"attributes": {
"id": 7,
"team_id": 40,
"key": "VOLUPTAS_PROVIDENT_EST_RATIONE_QUO",
"control": false,
"description": "Sequi aut quaerat sit nam velit at quia. Nostrum vero vitae debitis. Iste et eum et veritatis.",
"created": {
"human": "1 second ago",
"string": "2024-04-08 10:42:02"
},
"updated": {
"human": "1 second ago",
"string": "2024-04-08 10:42:02"
}
},
"links": {
"self": {
"href": "http://checkmango.com/api/teams/40/experiments/MAGNAM_LABORIOSAM_VEL_ET/variants/VOLUPTAS_PROVIDENT_EST_RATIONE_QUO"
}
}
}
}
Response examples (403)
{
"message": "Unauthenticated."
}
Response examples (404)
{
"message": "Not Found"
}
Response examples (422)
{
"message": "The given data was invalid.",
"errors": {
"key": [
"The key has already been taken."
]
}
}