Select the winning A/B variant
curl --request POST \
--url https://api.orbit.devotel.io/api/v1/campaigns/{id}/ab-select-winner \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"variant_id": "4f6c1e2a-9b3d-4c7e-8a1f-2d5b6c7e8f90"
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/campaigns/{id}/ab-select-winner"
payload = { "variant_id": "4f6c1e2a-9b3d-4c7e-8a1f-2d5b6c7e8f90" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({variant_id: '4f6c1e2a-9b3d-4c7e-8a1f-2d5b6c7e8f90'})
};
fetch('https://api.orbit.devotel.io/api/v1/campaigns/{id}/ab-select-winner', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.orbit.devotel.io/api/v1/campaigns/{id}/ab-select-winner",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'variant_id' => '4f6c1e2a-9b3d-4c7e-8a1f-2d5b6c7e8f90'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.orbit.devotel.io/api/v1/campaigns/{id}/ab-select-winner"
payload := strings.NewReader("{\n \"variant_id\": \"4f6c1e2a-9b3d-4c7e-8a1f-2d5b6c7e8f90\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.orbit.devotel.io/api/v1/campaigns/{id}/ab-select-winner")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"variant_id\": \"4f6c1e2a-9b3d-4c7e-8a1f-2d5b6c7e8f90\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/campaigns/{id}/ab-select-winner")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"variant_id\": \"4f6c1e2a-9b3d-4c7e-8a1f-2d5b6c7e8f90\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"campaign_id": "<string>",
"ab_test_enabled": true,
"ab_winner_metric": "<string>",
"ab_holdout_percent": 123,
"ab_winner_selected_at": "2023-11-07T05:31:56Z",
"winner_variant_id": "<string>",
"total_assigned": 123,
"ab_bandit_enabled": true,
"variants": [
{
"variant": {},
"delivered_rate": 123,
"open_rate": 123,
"click_rate": 123,
"reply_rate": 123
}
]
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}Campaigns
Select the winning A/B variant
Manually promote one variant as the A/B-test winner, overriding automatic selection. The variant_id must belong to this campaign’s variant set; subsequent sends then use the chosen variant. Returns the refreshed A/B results, 422 when the variant does not belong to the campaign, and 404 when the campaign is missing.
POST
/
api
/
v1
/
campaigns
/
{id}
/
ab-select-winner
Select the winning A/B variant
curl --request POST \
--url https://api.orbit.devotel.io/api/v1/campaigns/{id}/ab-select-winner \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"variant_id": "4f6c1e2a-9b3d-4c7e-8a1f-2d5b6c7e8f90"
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/campaigns/{id}/ab-select-winner"
payload = { "variant_id": "4f6c1e2a-9b3d-4c7e-8a1f-2d5b6c7e8f90" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({variant_id: '4f6c1e2a-9b3d-4c7e-8a1f-2d5b6c7e8f90'})
};
fetch('https://api.orbit.devotel.io/api/v1/campaigns/{id}/ab-select-winner', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.orbit.devotel.io/api/v1/campaigns/{id}/ab-select-winner",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'variant_id' => '4f6c1e2a-9b3d-4c7e-8a1f-2d5b6c7e8f90'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.orbit.devotel.io/api/v1/campaigns/{id}/ab-select-winner"
payload := strings.NewReader("{\n \"variant_id\": \"4f6c1e2a-9b3d-4c7e-8a1f-2d5b6c7e8f90\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.orbit.devotel.io/api/v1/campaigns/{id}/ab-select-winner")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"variant_id\": \"4f6c1e2a-9b3d-4c7e-8a1f-2d5b6c7e8f90\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/campaigns/{id}/ab-select-winner")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"variant_id\": \"4f6c1e2a-9b3d-4c7e-8a1f-2d5b6c7e8f90\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"campaign_id": "<string>",
"ab_test_enabled": true,
"ab_winner_metric": "<string>",
"ab_holdout_percent": 123,
"ab_winner_selected_at": "2023-11-07T05:31:56Z",
"winner_variant_id": "<string>",
"total_assigned": 123,
"ab_bandit_enabled": true,
"variants": [
{
"variant": {},
"delivered_rate": 123,
"open_rate": 123,
"click_rate": 123,
"reply_rate": 123
}
]
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}Authorizations
BearerApiKey
Dashboard JWT token from Clerk
Path Parameters
Body
application/json
Id of the variant to mark as the winner.
⌘I