Campaigns
Update Campaign
Update a draft campaign’s content, labels, or reply-to settings
PUT
/
api
/
v1
/
campaigns
/
{campaignId}
Update Campaign
curl --request PUT \
--url https://api.sequenzy.com/api/v1/campaigns/{campaignId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"subject": "<string>",
"previewText": "<string>",
"preheaderText": "<string>",
"trackingCode": "<string>",
"html": "<string>",
"blocks": [
{}
],
"campaignData": {},
"computedLists": [
{}
],
"labels": [
{}
],
"replyTo": "<string>",
"replyProfileId": "<string>"
}
'import requests
url = "https://api.sequenzy.com/api/v1/campaigns/{campaignId}"
payload = {
"name": "<string>",
"subject": "<string>",
"previewText": "<string>",
"preheaderText": "<string>",
"trackingCode": "<string>",
"html": "<string>",
"blocks": [{}],
"campaignData": {},
"computedLists": [{}],
"labels": [{}],
"replyTo": "<string>",
"replyProfileId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
subject: '<string>',
previewText: '<string>',
preheaderText: '<string>',
trackingCode: '<string>',
html: '<string>',
blocks: [{}],
campaignData: {},
computedLists: [{}],
labels: [{}],
replyTo: '<string>',
replyProfileId: '<string>'
})
};
fetch('https://api.sequenzy.com/api/v1/campaigns/{campaignId}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'subject' => '<string>',
'previewText' => '<string>',
'preheaderText' => '<string>',
'trackingCode' => '<string>',
'html' => '<string>',
'blocks' => [
[
]
],
'campaignData' => [
],
'computedLists' => [
[
]
],
'labels' => [
[
]
],
'replyTo' => '<string>',
'replyProfileId' => '<string>'
]),
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/campaigns/{campaignId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"preheaderText\": \"<string>\",\n \"trackingCode\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ],\n \"campaignData\": {},\n \"computedLists\": [\n {}\n ],\n \"labels\": [\n {}\n ],\n \"replyTo\": \"<string>\",\n \"replyProfileId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.sequenzy.com/api/v1/campaigns/{campaignId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"preheaderText\": \"<string>\",\n \"trackingCode\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ],\n \"campaignData\": {},\n \"computedLists\": [\n {}\n ],\n \"labels\": [\n {}\n ],\n \"replyTo\": \"<string>\",\n \"replyProfileId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/campaigns/{campaignId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"preheaderText\": \"<string>\",\n \"trackingCode\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ],\n \"campaignData\": {},\n \"computedLists\": [\n {}\n ],\n \"labels\": [\n {}\n ],\n \"replyTo\": \"<string>\",\n \"replyProfileId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"campaign": {
"id": "camp_abc123",
"name": "April Launch",
"subject": "A quick update",
"status": "draft",
"labels": ["edm", "launch"],
"replyProfileId": "reply_abc123",
"replyToName": "Support",
"replyToEmail": "support@example.com",
"url": "https://sequenzy.com/dashboard/company/comp_abc123/campaign/camp_abc123",
"previewUrl": "https://sequenzy.com/dashboard/company/comp_abc123/campaign/camp_abc123?step=review"
}
}
{
"success": false,
"error": "Provide either replyProfileId or replyTo, not both."
}
{
"success": false,
"error": "Provide at least one of name, subject, previewText, preheaderText, html, blocks, replyTo, replyProfileId, trackingCode, campaignData, computedLists, or labels."
}
{
"success": false,
"error": "Provide either previewText or preheaderText, not both."
}
{
"success": false,
"error": "Rule must provide subscriberField or value unless operator is exists"
}
{
"success": false,
"error": "Campaign content: provide either html or blocks, not both."
}
{
"type": "validation",
"on": "body",
"property": "/replyTo",
"message": "Expected string to match 'email' format",
"summary": "Property 'replyTo' should be email"
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Campaign not found"
}
Update a draft campaign. You can change the campaign name, subject, labels, HTML body, Sequenzy block content, campaign data, computed lists, or reply-to profile.
Request
Campaign ID.
Updated campaign name.
Updated email subject line.
Updated inbox preview text. Send
null to clear it.Alias for
previewText.Campaign tracking code available to UTM templates as
{{campaign.trackingCode}}. Send an empty string or null to clear it.Updated HTML body. Sequenzy converts this into email blocks.
Updated Sequenzy email blocks. Use this instead of
html when you need
editor-compatible content or conditional blocks. Do not send both html and
blocks in the same request. Put block styling under styles; top-level
style keys like backgroundColor, backgroundOpacity, borderColor,
borderWidth, and borderRadius are normalized into styles.Campaign-scoped JSON data for repeat blocks and personalization. Send
null
to clear it.Computed list definitions derived from
campaignData at send time.Replacement label names. Send an empty array to clear labels. Missing labels
are created automatically. The API also accepts
label as a compatibility
alias.Existing reply profile email address for this company. Use this or
replyProfileId, not both.Reply profile ID for this company. Use this or
replyTo, not both.Campaign-scoped JSON data. For example, upload an
events array that this
campaign can use while rendering repeat blocks. The MVP supports up to 500
items per top-level array.Personalized list definitions that select items from
campaignData using
subscriber attributes. Templates can repeat over each list’s key; keys use
letters, numbers, underscores, and dots only. Use maxItems to cap how many
items each subscriber can receive in that list.curl -X PUT "https://api.sequenzy.com/api/v1/campaigns/camp_abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"blocks": [
{
"id": "pro-offer",
"type": "text",
"content": "<p>Your Pro upgrade is ready.</p>",
"variant": "paragraph",
"conditions": [
{ "id": "c1", "field": "variable", "operator": "is", "value": "plan:pro" }
]
}
]
}'
curl -X PUT "https://api.sequenzy.com/api/v1/campaigns/camp_abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"preheaderText": "A short preview for the inbox"}'
curl -X PUT "https://api.sequenzy.com/api/v1/campaigns/camp_abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"labels": ["edm", "launch"]}'
curl -X PUT "https://api.sequenzy.com/api/v1/campaigns/camp_abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"campaignData": {
"events": [
{
"id": "evt_123",
"title": "Romeo and Juliet",
"region": "Auckland",
"genre": "theatre",
"url": "https://example.com/events/evt_123"
}
]
},
"computedLists": [
{
"key": "recommendedEvents",
"source": "events",
"maxItems": 6,
"rules": [
{
"itemField": "region",
"operator": "equals",
"subscriberField": "region"
},
{
"itemField": "genre",
"operator": "in",
"subscriberField": "interests"
}
]
}
]
}'
Responses
{
"success": true,
"campaign": {
"id": "camp_abc123",
"name": "April Launch",
"subject": "A quick update",
"status": "draft",
"labels": ["edm", "launch"],
"replyProfileId": "reply_abc123",
"replyToName": "Support",
"replyToEmail": "support@example.com",
"url": "https://sequenzy.com/dashboard/company/comp_abc123/campaign/camp_abc123",
"previewUrl": "https://sequenzy.com/dashboard/company/comp_abc123/campaign/camp_abc123?step=review"
}
}
{
"success": false,
"error": "Provide either replyProfileId or replyTo, not both."
}
{
"success": false,
"error": "Provide at least one of name, subject, previewText, preheaderText, html, blocks, replyTo, replyProfileId, trackingCode, campaignData, computedLists, or labels."
}
{
"success": false,
"error": "Provide either previewText or preheaderText, not both."
}
{
"success": false,
"error": "Rule must provide subscriberField or value unless operator is exists"
}
{
"success": false,
"error": "Campaign content: provide either html or blocks, not both."
}
{
"type": "validation",
"on": "body",
"property": "/replyTo",
"message": "Expected string to match 'email' format",
"summary": "Property 'replyTo' should be email"
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Campaign not found"
}
⌘I
Update Campaign
curl --request PUT \
--url https://api.sequenzy.com/api/v1/campaigns/{campaignId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"subject": "<string>",
"previewText": "<string>",
"preheaderText": "<string>",
"trackingCode": "<string>",
"html": "<string>",
"blocks": [
{}
],
"campaignData": {},
"computedLists": [
{}
],
"labels": [
{}
],
"replyTo": "<string>",
"replyProfileId": "<string>"
}
'import requests
url = "https://api.sequenzy.com/api/v1/campaigns/{campaignId}"
payload = {
"name": "<string>",
"subject": "<string>",
"previewText": "<string>",
"preheaderText": "<string>",
"trackingCode": "<string>",
"html": "<string>",
"blocks": [{}],
"campaignData": {},
"computedLists": [{}],
"labels": [{}],
"replyTo": "<string>",
"replyProfileId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
subject: '<string>',
previewText: '<string>',
preheaderText: '<string>',
trackingCode: '<string>',
html: '<string>',
blocks: [{}],
campaignData: {},
computedLists: [{}],
labels: [{}],
replyTo: '<string>',
replyProfileId: '<string>'
})
};
fetch('https://api.sequenzy.com/api/v1/campaigns/{campaignId}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'subject' => '<string>',
'previewText' => '<string>',
'preheaderText' => '<string>',
'trackingCode' => '<string>',
'html' => '<string>',
'blocks' => [
[
]
],
'campaignData' => [
],
'computedLists' => [
[
]
],
'labels' => [
[
]
],
'replyTo' => '<string>',
'replyProfileId' => '<string>'
]),
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/campaigns/{campaignId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"preheaderText\": \"<string>\",\n \"trackingCode\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ],\n \"campaignData\": {},\n \"computedLists\": [\n {}\n ],\n \"labels\": [\n {}\n ],\n \"replyTo\": \"<string>\",\n \"replyProfileId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.sequenzy.com/api/v1/campaigns/{campaignId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"preheaderText\": \"<string>\",\n \"trackingCode\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ],\n \"campaignData\": {},\n \"computedLists\": [\n {}\n ],\n \"labels\": [\n {}\n ],\n \"replyTo\": \"<string>\",\n \"replyProfileId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/campaigns/{campaignId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"preheaderText\": \"<string>\",\n \"trackingCode\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ],\n \"campaignData\": {},\n \"computedLists\": [\n {}\n ],\n \"labels\": [\n {}\n ],\n \"replyTo\": \"<string>\",\n \"replyProfileId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"campaign": {
"id": "camp_abc123",
"name": "April Launch",
"subject": "A quick update",
"status": "draft",
"labels": ["edm", "launch"],
"replyProfileId": "reply_abc123",
"replyToName": "Support",
"replyToEmail": "support@example.com",
"url": "https://sequenzy.com/dashboard/company/comp_abc123/campaign/camp_abc123",
"previewUrl": "https://sequenzy.com/dashboard/company/comp_abc123/campaign/camp_abc123?step=review"
}
}
{
"success": false,
"error": "Provide either replyProfileId or replyTo, not both."
}
{
"success": false,
"error": "Provide at least one of name, subject, previewText, preheaderText, html, blocks, replyTo, replyProfileId, trackingCode, campaignData, computedLists, or labels."
}
{
"success": false,
"error": "Provide either previewText or preheaderText, not both."
}
{
"success": false,
"error": "Rule must provide subscriberField or value unless operator is exists"
}
{
"success": false,
"error": "Campaign content: provide either html or blocks, not both."
}
{
"type": "validation",
"on": "body",
"property": "/replyTo",
"message": "Expected string to match 'email' format",
"summary": "Property 'replyTo' should be email"
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Campaign not found"
}