A/B Tests
Update A/B Test Variant
Update an A/B test variant
PATCH
/
api
/
v1
/
ab-tests
/
{abTestId}
/
variants
/
{variantId}
Update A/B Test Variant
curl --request PATCH \
--url https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/variants/{variantId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "<string>",
"previewText": "<string>",
"html": "<string>",
"blocks": [
{}
],
"confirmLiveChange": true
}
'import requests
url = "https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/variants/{variantId}"
payload = {
"subject": "<string>",
"previewText": "<string>",
"html": "<string>",
"blocks": [{}],
"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({
subject: '<string>',
previewText: '<string>',
html: '<string>',
blocks: [{}],
confirmLiveChange: true
})
};
fetch('https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/variants/{variantId}', 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}/variants/{variantId}",
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([
'subject' => '<string>',
'previewText' => '<string>',
'html' => '<string>',
'blocks' => [
[
]
],
'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}/variants/{variantId}"
payload := strings.NewReader("{\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ],\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}/variants/{variantId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ],\n \"confirmLiveChange\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/variants/{variantId}")
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 \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ],\n \"confirmLiveChange\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"variant": {
"id": "var_b",
"label": "B",
"emailId": "email_def456",
"subject": "A better subject",
"previewText": null,
"blocks": [],
"localizations": []
}
}
{
"success": false,
"error": "Previous sends cannot be changed. Editing this variant changes future sends that use it, so the A/B test results may combine different versions and may no longer be accurate. Set confirmLiveChange=true to continue."
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Variant not found"
}
{
"success": false,
"error": "Failed to update variant"
}
Update an A/B test variant’s subject, preview text, or body content. You can use raw HTML or Sequenzy block JSON for the body. Campaign variants remain editable only while the test is in draft. Sequence variants can be edited later with explicit confirmation because the change affects future sends and can make results combine different content versions.
Request
string
required
A/B test ID.
string
required
Variant ID.
string
Updated subject line.
string
Updated preview text. Send
null to clear it.string
Replacement HTML body. Use this or
blocks, not both.array
Replacement Sequenzy email blocks. Use this or
html, not both. Put block
styling under styles; top-level style keys like backgroundColor,
backgroundOpacity, borderColor, borderWidth, and borderRadius are
normalized into styles.boolean
Required as
true when the sequence is active, the test is no longer a draft,
or the test has recorded activity. Earlier sends are unchanged, so the
combined A/B test results may no longer be accurate.curl -X PATCH "https://api.sequenzy.com/api/v1/ab-tests/ab_abc123/variants/var_b" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"subject": "A better subject", "confirmLiveChange": true}'
Responses
{
"success": true,
"variant": {
"id": "var_b",
"label": "B",
"emailId": "email_def456",
"subject": "A better subject",
"previewText": null,
"blocks": [],
"localizations": []
}
}
{
"success": false,
"error": "Previous sends cannot be changed. Editing this variant changes future sends that use it, so the A/B test results may combine different versions and may no longer be accurate. Set confirmLiveChange=true to continue."
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Variant not found"
}
{
"success": false,
"error": "Failed to update variant"
}
⌘I
Update A/B Test Variant
curl --request PATCH \
--url https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/variants/{variantId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "<string>",
"previewText": "<string>",
"html": "<string>",
"blocks": [
{}
],
"confirmLiveChange": true
}
'import requests
url = "https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/variants/{variantId}"
payload = {
"subject": "<string>",
"previewText": "<string>",
"html": "<string>",
"blocks": [{}],
"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({
subject: '<string>',
previewText: '<string>',
html: '<string>',
blocks: [{}],
confirmLiveChange: true
})
};
fetch('https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/variants/{variantId}', 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}/variants/{variantId}",
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([
'subject' => '<string>',
'previewText' => '<string>',
'html' => '<string>',
'blocks' => [
[
]
],
'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}/variants/{variantId}"
payload := strings.NewReader("{\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ],\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}/variants/{variantId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ],\n \"confirmLiveChange\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/ab-tests/{abTestId}/variants/{variantId}")
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 \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ],\n \"confirmLiveChange\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"variant": {
"id": "var_b",
"label": "B",
"emailId": "email_def456",
"subject": "A better subject",
"previewText": null,
"blocks": [],
"localizations": []
}
}
{
"success": false,
"error": "Previous sends cannot be changed. Editing this variant changes future sends that use it, so the A/B test results may combine different versions and may no longer be accurate. Set confirmLiveChange=true to continue."
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Variant not found"
}
{
"success": false,
"error": "Failed to update variant"
}