Campaigns
Workflow campaign A/B tests API
Compare the agent versions of each A/B-tested agent node in a campaign: calls, completed calls, call time and journey outcomes per version.
GET
/
workflow-campaigns
/
{campaign_id}
/
ab-tests
cURL
curl --request GET \
--url https://api.bolna.ai/workflow-campaigns/{campaign_id}/ab-tests \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bolna.ai/workflow-campaigns/{campaign_id}/ab-tests"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bolna.ai/workflow-campaigns/{campaign_id}/ab-tests', 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.bolna.ai/workflow-campaigns/{campaign_id}/ab-tests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.bolna.ai/workflow-campaigns/{campaign_id}/ab-tests"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.bolna.ai/workflow-campaigns/{campaign_id}/ab-tests")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bolna.ai/workflow-campaigns/{campaign_id}/ab-tests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"nodes": [
{
"node_id": "n_call",
"node_name": "Qualification call",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sticky": true,
"arms": [
{
"agent_version_id": "0b6e2c1a-7f3d-4e8a-9c21-5d4f6a7b8c90",
"weight": 50
},
{
"agent_version_id": "5e8f9a0b-1c2d-4e3f-8a4b-6c7d8e9f0a1b",
"weight": 50
}
],
"results": [
{
"agent_version_id": "0b6e2c1a-7f3d-4e8a-9c21-5d4f6a7b8c90",
"agent_version_name": "v1",
"calls": 1204,
"completed": 731,
"duration_s": 143280,
"journeys": {
"settled": 1010,
"success": 286,
"failure": 552,
"neutral": 160
}
},
{
"agent_version_id": "5e8f9a0b-1c2d-4e3f-8a4b-6c7d8e9f0a1b",
"agent_version_name": "v2-short-greeting",
"calls": 1188,
"completed": 779,
"duration_s": 131040,
"journeys": {
"settled": 996,
"success": 331,
"failure": 509,
"neutral": 149
}
}
]
}
]
}{
"detail": {
"code": "revision_conflict",
"message": "<string>"
}
}Results are raw counts, worked out each time you call the endpoint.
journeys counts finished journeys only, and is null for a node whose sticky is false, because one journey can then use several versions. See A/B test agent versions for how each number is counted.Authorizations
Was this page helpful?
⌘I
cURL
curl --request GET \
--url https://api.bolna.ai/workflow-campaigns/{campaign_id}/ab-tests \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bolna.ai/workflow-campaigns/{campaign_id}/ab-tests"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bolna.ai/workflow-campaigns/{campaign_id}/ab-tests', 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.bolna.ai/workflow-campaigns/{campaign_id}/ab-tests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.bolna.ai/workflow-campaigns/{campaign_id}/ab-tests"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.bolna.ai/workflow-campaigns/{campaign_id}/ab-tests")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bolna.ai/workflow-campaigns/{campaign_id}/ab-tests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"nodes": [
{
"node_id": "n_call",
"node_name": "Qualification call",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sticky": true,
"arms": [
{
"agent_version_id": "0b6e2c1a-7f3d-4e8a-9c21-5d4f6a7b8c90",
"weight": 50
},
{
"agent_version_id": "5e8f9a0b-1c2d-4e3f-8a4b-6c7d8e9f0a1b",
"weight": 50
}
],
"results": [
{
"agent_version_id": "0b6e2c1a-7f3d-4e8a-9c21-5d4f6a7b8c90",
"agent_version_name": "v1",
"calls": 1204,
"completed": 731,
"duration_s": 143280,
"journeys": {
"settled": 1010,
"success": 286,
"failure": 552,
"neutral": 160
}
},
{
"agent_version_id": "5e8f9a0b-1c2d-4e3f-8a4b-6c7d8e9f0a1b",
"agent_version_name": "v2-short-greeting",
"calls": 1188,
"completed": 779,
"duration_s": 131040,
"journeys": {
"settled": 996,
"success": 331,
"failure": 509,
"neutral": 149
}
}
]
}
]
}{
"detail": {
"code": "revision_conflict",
"message": "<string>"
}
}