Resolve a sticky A/B variant assignment
curl --request POST \
--url https://api.orbit.devotel.io/api/v1/agents/{id}/ab-assignments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contact_id": "contact_7a1b2c3d",
"conversation_id": "conv_9f3c1a2b"
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/agents/{id}/ab-assignments"
payload = {
"contact_id": "contact_7a1b2c3d",
"conversation_id": "conv_9f3c1a2b"
}
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({contact_id: 'contact_7a1b2c3d', conversation_id: 'conv_9f3c1a2b'})
};
fetch('https://api.orbit.devotel.io/api/v1/agents/{id}/ab-assignments', 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/agents/{id}/ab-assignments",
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([
'contact_id' => 'contact_7a1b2c3d',
'conversation_id' => 'conv_9f3c1a2b'
]),
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/agents/{id}/ab-assignments"
payload := strings.NewReader("{\n \"contact_id\": \"contact_7a1b2c3d\",\n \"conversation_id\": \"conv_9f3c1a2b\"\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/agents/{id}/ab-assignments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contact_id\": \"contact_7a1b2c3d\",\n \"conversation_id\": \"conv_9f3c1a2b\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/agents/{id}/ab-assignments")
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 \"contact_id\": \"contact_7a1b2c3d\",\n \"conversation_id\": \"conv_9f3c1a2b\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"has_experiment": true,
"experiment_id": "<string>",
"assignment_id": "<string>",
"variant": "a",
"version_id": "<string>",
"conversion_metric": "<string>",
"effective_split_pct": 123
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}Agents
Resolve a sticky A/B variant assignment
Assign a contact to a variant of the agent’s active A/B experiment and return the variant plus the prompt version to apply. The assignment is sticky per contact — the first call rolls the variant using the adaptive traffic split and records an impression, and later calls return the same variant without re-rolling. Pass dry_run: true to preview the would-be variant without persisting. Requires the owner, admin, or developer role.
POST
/
api
/
v1
/
agents
/
{id}
/
ab-assignments
Resolve a sticky A/B variant assignment
curl --request POST \
--url https://api.orbit.devotel.io/api/v1/agents/{id}/ab-assignments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contact_id": "contact_7a1b2c3d",
"conversation_id": "conv_9f3c1a2b"
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/agents/{id}/ab-assignments"
payload = {
"contact_id": "contact_7a1b2c3d",
"conversation_id": "conv_9f3c1a2b"
}
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({contact_id: 'contact_7a1b2c3d', conversation_id: 'conv_9f3c1a2b'})
};
fetch('https://api.orbit.devotel.io/api/v1/agents/{id}/ab-assignments', 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/agents/{id}/ab-assignments",
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([
'contact_id' => 'contact_7a1b2c3d',
'conversation_id' => 'conv_9f3c1a2b'
]),
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/agents/{id}/ab-assignments"
payload := strings.NewReader("{\n \"contact_id\": \"contact_7a1b2c3d\",\n \"conversation_id\": \"conv_9f3c1a2b\"\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/agents/{id}/ab-assignments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contact_id\": \"contact_7a1b2c3d\",\n \"conversation_id\": \"conv_9f3c1a2b\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/agents/{id}/ab-assignments")
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 \"contact_id\": \"contact_7a1b2c3d\",\n \"conversation_id\": \"conv_9f3c1a2b\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"has_experiment": true,
"experiment_id": "<string>",
"assignment_id": "<string>",
"variant": "a",
"version_id": "<string>",
"conversion_metric": "<string>",
"effective_split_pct": 123
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}Authorizations
BearerApiKey
Dashboard JWT token from Clerk
Path Parameters
Identifier of the agent running the experiment.
Body
application/json
⌘I