A/B Tests
Update A/B Test
Update campaign or sequence A/B test settings
PATCH
/
api
/
v1
/
ab-tests
/
{abTestId}
Update A/B Test
curl --request PATCH \
--url https://api.sequenzy.com/api/v1/ab-tests/{abTestId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"testPercentage": 123,
"testDurationMinutes": 123,
"winnerCriteria": "<string>",
"testType": "<string>",
"winnerThreshold": 123,
"confirmLiveChange": true
}
'import requests
url = "https://api.sequenzy.com/api/v1/ab-tests/{abTestId}"
payload = {
"name": "<string>",
"testPercentage": 123,
"testDurationMinutes": 123,
"winnerCriteria": "<string>",
"testType": "<string>",
"winnerThreshold": 123,
"confirmLiveChange": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
testPercentage: 123,
testDurationMinutes: 123,
winnerCriteria: '<string>',
testType: '<string>',
winnerThreshold: 123,
confirmLiveChange: true
})
};
fetch('https://api.sequenzy.com/api/v1/ab-tests/{abTestId}', 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.sequenzy.com/api/v1/ab-tests/{abTestId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'testPercentage' => 123,
'testDurationMinutes' => 123,
'winnerCriteria' => '<string>',
'testType' => '<string>',
'winnerThreshold' => 123,
'confirmLiveChange' => true
]),
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.sequenzy.com/api/v1/ab-tests/{abTestId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"testPercentage\": 123,\n \"testDurationMinutes\": 123,\n \"winnerCriteria\": \"<string>\",\n \"testType\": \"<string>\",\n \"winnerThreshold\": 123,\n \"confirmLiveChange\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sequenzy.com/api/v1/ab-tests/{abTestId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"testPercentage\": 123,\n \"testDurationMinutes\": 123,\n \"winnerCriteria\": \"<string>\",\n \"testType\": \"<string>\",\n \"winnerThreshold\": 123,\n \"confirmLiveChange\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/ab-tests/{abTestId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"testPercentage\": 123,\n \"testDurationMinutes\": 123,\n \"winnerCriteria\": \"<string>\",\n \"testType\": \"<string>\",\n \"winnerThreshold\": 123,\n \"confirmLiveChange\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"abTest": {
"id": "ab_abc123",
"kind": "sequence",
"automationNodeId": "node_abc123",
"winnerCriteria": "open_rate",
"testType": "content",
"winnerThreshold": 150,
"settings": {
"testType": "content",
"winnerThreshold": 150,
"winnerCriteria": "open_rate"
}
}
}
{
"success": false,
"error": "Sequence A/B tests use testType and winnerThreshold; testPercentage and testDurationMinutes apply only to campaign A/B tests"
}
{
"success": false,
"error": "A/B test not found"
}
Update an A/B test’s effective settings. Campaign and sequence tests use
different selection models:
- Campaign tests use
testPercentage,testDurationMinutes, andwinnerCriteria. - Sequence tests use
testType,winnerThreshold, andwinnerCriteria.
confirmLiveChange: true.
Request
string
required
A/B test ID.
string
Updated test name.
number
Campaign-only share of the audience used for testing, from 5 to 50.
number
Campaign-only duration before winner selection, from 15 to 1440 minutes.
string
Winner metric for either test kind:
open_rate or click_rate.string
Sequence-only variant strategy:
subject or content. When winnerCriteria
is omitted, subject defaults to open_rate and content defaults to
click_rate.number
Sequence-only number of recipients before selecting a winner, from 10 to 1000.
boolean
Required as
true when changing selection settings for an active sequence
test or one with recorded activity.curl -X PATCH "https://api.sequenzy.com/api/v1/ab-tests/ab_abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"testType": "content",
"winnerCriteria": "open_rate",
"winnerThreshold": 150,
"confirmLiveChange": true
}'
Response
The response includeskind and an effective settings object. Use
settings when copying a test. The legacy testPercentage: 100 and
testDurationMinutes: 0 fields on sequence tests are retained for backwards
compatibility and are not sequence runtime settings.
{
"success": true,
"abTest": {
"id": "ab_abc123",
"kind": "sequence",
"automationNodeId": "node_abc123",
"winnerCriteria": "open_rate",
"testType": "content",
"winnerThreshold": 150,
"settings": {
"testType": "content",
"winnerThreshold": 150,
"winnerCriteria": "open_rate"
}
}
}
{
"success": false,
"error": "Sequence A/B tests use testType and winnerThreshold; testPercentage and testDurationMinutes apply only to campaign A/B tests"
}
{
"success": false,
"error": "A/B test not found"
}
⌘I
Update A/B Test
curl --request PATCH \
--url https://api.sequenzy.com/api/v1/ab-tests/{abTestId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"testPercentage": 123,
"testDurationMinutes": 123,
"winnerCriteria": "<string>",
"testType": "<string>",
"winnerThreshold": 123,
"confirmLiveChange": true
}
'import requests
url = "https://api.sequenzy.com/api/v1/ab-tests/{abTestId}"
payload = {
"name": "<string>",
"testPercentage": 123,
"testDurationMinutes": 123,
"winnerCriteria": "<string>",
"testType": "<string>",
"winnerThreshold": 123,
"confirmLiveChange": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
testPercentage: 123,
testDurationMinutes: 123,
winnerCriteria: '<string>',
testType: '<string>',
winnerThreshold: 123,
confirmLiveChange: true
})
};
fetch('https://api.sequenzy.com/api/v1/ab-tests/{abTestId}', 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.sequenzy.com/api/v1/ab-tests/{abTestId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'testPercentage' => 123,
'testDurationMinutes' => 123,
'winnerCriteria' => '<string>',
'testType' => '<string>',
'winnerThreshold' => 123,
'confirmLiveChange' => true
]),
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.sequenzy.com/api/v1/ab-tests/{abTestId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"testPercentage\": 123,\n \"testDurationMinutes\": 123,\n \"winnerCriteria\": \"<string>\",\n \"testType\": \"<string>\",\n \"winnerThreshold\": 123,\n \"confirmLiveChange\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sequenzy.com/api/v1/ab-tests/{abTestId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"testPercentage\": 123,\n \"testDurationMinutes\": 123,\n \"winnerCriteria\": \"<string>\",\n \"testType\": \"<string>\",\n \"winnerThreshold\": 123,\n \"confirmLiveChange\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/ab-tests/{abTestId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"testPercentage\": 123,\n \"testDurationMinutes\": 123,\n \"winnerCriteria\": \"<string>\",\n \"testType\": \"<string>\",\n \"winnerThreshold\": 123,\n \"confirmLiveChange\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"abTest": {
"id": "ab_abc123",
"kind": "sequence",
"automationNodeId": "node_abc123",
"winnerCriteria": "open_rate",
"testType": "content",
"winnerThreshold": 150,
"settings": {
"testType": "content",
"winnerThreshold": 150,
"winnerCriteria": "open_rate"
}
}
}
{
"success": false,
"error": "Sequence A/B tests use testType and winnerThreshold; testPercentage and testDurationMinutes apply only to campaign A/B tests"
}
{
"success": false,
"error": "A/B test not found"
}