Campaigns
Use Campaign Variation
Put a variation’s content in the campaign email
POST
/
api
/
v1
/
campaigns
/
{campaignId}
/
variations
/
{variationId}
/
use
Use Campaign Variation
curl --request POST \
--url https://api.sequenzy.com/api/v1/campaigns/{campaignId}/variations/{variationId}/use \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sequenzy.com/api/v1/campaigns/{campaignId}/variations/{variationId}/use"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sequenzy.com/api/v1/campaigns/{campaignId}/variations/{variationId}/use', 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/campaigns/{campaignId}/variations/{variationId}/use",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.sequenzy.com/api/v1/campaigns/{campaignId}/variations/{variationId}/use"
req, _ := http.NewRequest("POST", 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.post("https://api.sequenzy.com/api/v1/campaigns/{campaignId}/variations/{variationId}/use")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/campaigns/{campaignId}/variations/{variationId}/use")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"variation": {
"id": "var_9xk2",
"emailId": "email_abc123",
"parentId": null,
"label": "V2",
"name": "Warm and personal",
"summary": "Rewrote the opening in a friendlier voice and shortened the body.",
"prompt": "Three warmer, shorter versions",
"style": "fresh",
"status": "ready",
"error": null,
"subject": "A quick note about our pricing",
"previewText": null,
"blocks": [
{ "id": "h1", "type": "heading", "content": "A quick note about pricing", "level": 1 }
],
"emailTheme": null,
"fontFamily": null,
"position": null,
"inUse": true,
"usedAt": "2026-10-14T09:20:00.000Z",
"createdAt": "2026-10-14T09:12:00.000Z",
"updatedAt": "2026-10-14T09:12:41.000Z"
},
"savedPrevious": null
}
{
"error": "Can only use a variation in a draft campaign"
}
{
"error": "Invalid API key"
}
{
"error": "Variation not found"
}
{
"error": "Only a finished variation can be used"
}
Copies a
ready variation into the campaign email: its blocks, plus its subject, preview text, theme and font when it has its own. When it has its own look, the other variations that follow the email’s look keep the one it had, so they don’t all change with it. Draft campaigns only. Translations are re-derived from the new content.
If the email’s current content is not already one of the variations, it is saved first as a new variation named “Before” plus the label you used, and returned as savedPrevious, so you can always go back. Using that saved variation later restores the previous content.
Request
string
required
Campaign ID. Email campaigns only.
string
required
Variation ID.
curl -X POST "https://api.sequenzy.com/api/v1/campaigns/camp_abc123/variations/var_9xk2/use" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
object
The variation you used, now with
inUse: true.object | null
The email’s previous content, saved as a variation.
null when it already was
one.{
"success": true,
"variation": {
"id": "var_9xk2",
"emailId": "email_abc123",
"parentId": null,
"label": "V2",
"name": "Warm and personal",
"summary": "Rewrote the opening in a friendlier voice and shortened the body.",
"prompt": "Three warmer, shorter versions",
"style": "fresh",
"status": "ready",
"error": null,
"subject": "A quick note about our pricing",
"previewText": null,
"blocks": [
{ "id": "h1", "type": "heading", "content": "A quick note about pricing", "level": 1 }
],
"emailTheme": null,
"fontFamily": null,
"position": null,
"inUse": true,
"usedAt": "2026-10-14T09:20:00.000Z",
"createdAt": "2026-10-14T09:12:00.000Z",
"updatedAt": "2026-10-14T09:12:41.000Z"
},
"savedPrevious": null
}
{
"error": "Can only use a variation in a draft campaign"
}
{
"error": "Invalid API key"
}
{
"error": "Variation not found"
}
{
"error": "Only a finished variation can be used"
}
⌘I
Use Campaign Variation
curl --request POST \
--url https://api.sequenzy.com/api/v1/campaigns/{campaignId}/variations/{variationId}/use \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sequenzy.com/api/v1/campaigns/{campaignId}/variations/{variationId}/use"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sequenzy.com/api/v1/campaigns/{campaignId}/variations/{variationId}/use', 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/campaigns/{campaignId}/variations/{variationId}/use",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.sequenzy.com/api/v1/campaigns/{campaignId}/variations/{variationId}/use"
req, _ := http.NewRequest("POST", 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.post("https://api.sequenzy.com/api/v1/campaigns/{campaignId}/variations/{variationId}/use")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/campaigns/{campaignId}/variations/{variationId}/use")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"variation": {
"id": "var_9xk2",
"emailId": "email_abc123",
"parentId": null,
"label": "V2",
"name": "Warm and personal",
"summary": "Rewrote the opening in a friendlier voice and shortened the body.",
"prompt": "Three warmer, shorter versions",
"style": "fresh",
"status": "ready",
"error": null,
"subject": "A quick note about our pricing",
"previewText": null,
"blocks": [
{ "id": "h1", "type": "heading", "content": "A quick note about pricing", "level": 1 }
],
"emailTheme": null,
"fontFamily": null,
"position": null,
"inUse": true,
"usedAt": "2026-10-14T09:20:00.000Z",
"createdAt": "2026-10-14T09:12:00.000Z",
"updatedAt": "2026-10-14T09:12:41.000Z"
},
"savedPrevious": null
}
{
"error": "Can only use a variation in a draft campaign"
}
{
"error": "Invalid API key"
}
{
"error": "Variation not found"
}
{
"error": "Only a finished variation can be used"
}