A/B Tests
Restart A/B Test
Run another sequence A/B test
POST
/
api
/
v1
/
ab-tests
/
{abTestId}
/
restart
Restart A/B Test
curl --request POST \
--url https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/restart \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceVariantId": "<string>",
"testType": "<string>",
"winnerThreshold": 123,
"variantCount": 123
}
'import requests
url = "https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/restart"
payload = {
"sourceVariantId": "<string>",
"testType": "<string>",
"winnerThreshold": 123,
"variantCount": 123
}
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({
sourceVariantId: '<string>',
testType: '<string>',
winnerThreshold: 123,
variantCount: 123
})
};
fetch('https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/restart', 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}/restart",
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([
'sourceVariantId' => '<string>',
'testType' => '<string>',
'winnerThreshold' => 123,
'variantCount' => 123
]),
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}/restart"
payload := strings.NewReader("{\n \"sourceVariantId\": \"<string>\",\n \"testType\": \"<string>\",\n \"winnerThreshold\": 123,\n \"variantCount\": 123\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.sequenzy.com/api/v1/ab-tests/{abTestId}/restart")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sourceVariantId\": \"<string>\",\n \"testType\": \"<string>\",\n \"winnerThreshold\": 123,\n \"variantCount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/restart")
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 \"sourceVariantId\": \"<string>\",\n \"testType\": \"<string>\",\n \"winnerThreshold\": 123,\n \"variantCount\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"previousAbTestId": "ab_abc123",
"sourceVariantId": "var_b",
"abTest": {
"id": "ab_new123",
"status": "draft",
"variants": [{ "id": "var_new_a", "label": "A" }]
},
"nodeConfig": {
"abTestId": "ab_abc123",
"winnerId": "var_winner",
"pendingAbTestId": "ab_new123",
"pendingExpectedVariantCount": 3
}
}
{
"success": false,
"error": "A winner must be selected before running another A/B test."
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Selected control email not found"
}
{
"success": false,
"error": "Failed to create A/B test"
}
Start a new draft A/B test for the same sequence node after a winner has been selected. The previous test and metrics stay intact, and the new test becomes active after its generated variants are ready.
Request
string
required
A/B test ID to restart.
string
Variant ID to use as the new control email. Defaults to the selected winner.
string
Test type:
subject or content. Defaults to subject.number
Subscribers before selecting a winner. Must be from 10 to 1000.
number
Total variants including the control. Must be from 2 to 4.
curl -X POST "https://api.sequenzy.com/api/v1/ab-tests/ab_abc123/restart" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sourceVariantId": "var_b", "testType": "content", "variantCount": 3}'
Responses
{
"success": true,
"previousAbTestId": "ab_abc123",
"sourceVariantId": "var_b",
"abTest": {
"id": "ab_new123",
"status": "draft",
"variants": [{ "id": "var_new_a", "label": "A" }]
},
"nodeConfig": {
"abTestId": "ab_abc123",
"winnerId": "var_winner",
"pendingAbTestId": "ab_new123",
"pendingExpectedVariantCount": 3
}
}
{
"success": false,
"error": "A winner must be selected before running another A/B test."
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Selected control email not found"
}
{
"success": false,
"error": "Failed to create A/B test"
}
⌘I
Restart A/B Test
curl --request POST \
--url https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/restart \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceVariantId": "<string>",
"testType": "<string>",
"winnerThreshold": 123,
"variantCount": 123
}
'import requests
url = "https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/restart"
payload = {
"sourceVariantId": "<string>",
"testType": "<string>",
"winnerThreshold": 123,
"variantCount": 123
}
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({
sourceVariantId: '<string>',
testType: '<string>',
winnerThreshold: 123,
variantCount: 123
})
};
fetch('https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/restart', 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}/restart",
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([
'sourceVariantId' => '<string>',
'testType' => '<string>',
'winnerThreshold' => 123,
'variantCount' => 123
]),
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}/restart"
payload := strings.NewReader("{\n \"sourceVariantId\": \"<string>\",\n \"testType\": \"<string>\",\n \"winnerThreshold\": 123,\n \"variantCount\": 123\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.sequenzy.com/api/v1/ab-tests/{abTestId}/restart")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sourceVariantId\": \"<string>\",\n \"testType\": \"<string>\",\n \"winnerThreshold\": 123,\n \"variantCount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/restart")
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 \"sourceVariantId\": \"<string>\",\n \"testType\": \"<string>\",\n \"winnerThreshold\": 123,\n \"variantCount\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"previousAbTestId": "ab_abc123",
"sourceVariantId": "var_b",
"abTest": {
"id": "ab_new123",
"status": "draft",
"variants": [{ "id": "var_new_a", "label": "A" }]
},
"nodeConfig": {
"abTestId": "ab_abc123",
"winnerId": "var_winner",
"pendingAbTestId": "ab_new123",
"pendingExpectedVariantCount": 3
}
}
{
"success": false,
"error": "A winner must be selected before running another A/B test."
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Selected control email not found"
}
{
"success": false,
"error": "Failed to create A/B test"
}