curl --request PATCH \
--url https://api.parallellabs.app/api/v0/marketing-campaigns/{campaignId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"subject": "<string>",
"fromName": "<string>",
"replyTo": "<string>",
"bodyHtml": "<string>",
"bodyDocument": "<string>",
"poll": {},
"senderProfileId": "<string>",
"listId": "<string>",
"fieldMappings": {},
"scheduleType": "<string>",
"scheduledAt": "<string>",
"timezone": "<string>",
"scheduleSettings": {}
}
'import requests
url = "https://api.parallellabs.app/api/v0/marketing-campaigns/{campaignId}"
payload = {
"name": "<string>",
"subject": "<string>",
"fromName": "<string>",
"replyTo": "<string>",
"bodyHtml": "<string>",
"bodyDocument": "<string>",
"poll": {},
"senderProfileId": "<string>",
"listId": "<string>",
"fieldMappings": {},
"scheduleType": "<string>",
"scheduledAt": "<string>",
"timezone": "<string>",
"scheduleSettings": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
subject: '<string>',
fromName: '<string>',
replyTo: '<string>',
bodyHtml: '<string>',
bodyDocument: '<string>',
poll: {},
senderProfileId: '<string>',
listId: '<string>',
fieldMappings: {},
scheduleType: '<string>',
scheduledAt: '<string>',
timezone: '<string>',
scheduleSettings: {}
})
};
fetch('https://api.parallellabs.app/api/v0/marketing-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.parallellabs.app/api/v0/marketing-campaigns/{campaignId}",
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>',
'subject' => '<string>',
'fromName' => '<string>',
'replyTo' => '<string>',
'bodyHtml' => '<string>',
'bodyDocument' => '<string>',
'poll' => [
],
'senderProfileId' => '<string>',
'listId' => '<string>',
'fieldMappings' => [
],
'scheduleType' => '<string>',
'scheduledAt' => '<string>',
'timezone' => '<string>',
'scheduleSettings' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.parallellabs.app/api/v0/marketing-campaigns/{campaignId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"bodyHtml\": \"<string>\",\n \"bodyDocument\": \"<string>\",\n \"poll\": {},\n \"senderProfileId\": \"<string>\",\n \"listId\": \"<string>\",\n \"fieldMappings\": {},\n \"scheduleType\": \"<string>\",\n \"scheduledAt\": \"<string>\",\n \"timezone\": \"<string>\",\n \"scheduleSettings\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.parallellabs.app/api/v0/marketing-campaigns/{campaignId}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"bodyHtml\": \"<string>\",\n \"bodyDocument\": \"<string>\",\n \"poll\": {},\n \"senderProfileId\": \"<string>\",\n \"listId\": \"<string>\",\n \"fieldMappings\": {},\n \"scheduleType\": \"<string>\",\n \"scheduledAt\": \"<string>\",\n \"timezone\": \"<string>\",\n \"scheduleSettings\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.parallellabs.app/api/v0/marketing-campaigns/{campaignId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"bodyHtml\": \"<string>\",\n \"bodyDocument\": \"<string>\",\n \"poll\": {},\n \"senderProfileId\": \"<string>\",\n \"listId\": \"<string>\",\n \"fieldMappings\": {},\n \"scheduleType\": \"<string>\",\n \"scheduledAt\": \"<string>\",\n \"timezone\": \"<string>\",\n \"scheduleSettings\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"companyId": "<string>",
"uid": "<string>",
"name": "<string>",
"subject": "<string>",
"fromName": "<string>",
"replyTo": "<string>",
"bodyHtml": "<string>",
"bodyDocument": "<string>",
"poll": "<string>",
"senderProfileId": "<string>",
"listId": "<string>",
"fieldMappings": {},
"scheduleType": "<string>",
"scheduledAt": "<string>",
"timezone": "<string>",
"status": "<string>",
"sentCount": 123,
"failedCount": 123,
"skippedCount": 123,
"totalRecipients": 123,
"delivered": 123,
"uniqueOpens": 123,
"uniqueClicks": 123,
"hasContent": true,
"startedAt": "<string>",
"completedAt": "<string>",
"created_date": "<string>",
"updated_date": "<string>",
"smartList": {
"id": "<string>",
"name": "<string>"
},
"senderProfile": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"integrationId": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Update a marketing campaign. While sending, content, sender and sending
windows can change for remaining recipients. Recipient targeting, launch time and poll definitions are locked; delivery keeps its existing progress. Full editing is available in draft, scheduled, cancelled, or failed status. Editing a scheduled campaign drops it back to draft until re-scheduled. Sent campaigns cannot be edited.
curl --request PATCH \
--url https://api.parallellabs.app/api/v0/marketing-campaigns/{campaignId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"subject": "<string>",
"fromName": "<string>",
"replyTo": "<string>",
"bodyHtml": "<string>",
"bodyDocument": "<string>",
"poll": {},
"senderProfileId": "<string>",
"listId": "<string>",
"fieldMappings": {},
"scheduleType": "<string>",
"scheduledAt": "<string>",
"timezone": "<string>",
"scheduleSettings": {}
}
'import requests
url = "https://api.parallellabs.app/api/v0/marketing-campaigns/{campaignId}"
payload = {
"name": "<string>",
"subject": "<string>",
"fromName": "<string>",
"replyTo": "<string>",
"bodyHtml": "<string>",
"bodyDocument": "<string>",
"poll": {},
"senderProfileId": "<string>",
"listId": "<string>",
"fieldMappings": {},
"scheduleType": "<string>",
"scheduledAt": "<string>",
"timezone": "<string>",
"scheduleSettings": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
subject: '<string>',
fromName: '<string>',
replyTo: '<string>',
bodyHtml: '<string>',
bodyDocument: '<string>',
poll: {},
senderProfileId: '<string>',
listId: '<string>',
fieldMappings: {},
scheduleType: '<string>',
scheduledAt: '<string>',
timezone: '<string>',
scheduleSettings: {}
})
};
fetch('https://api.parallellabs.app/api/v0/marketing-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.parallellabs.app/api/v0/marketing-campaigns/{campaignId}",
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>',
'subject' => '<string>',
'fromName' => '<string>',
'replyTo' => '<string>',
'bodyHtml' => '<string>',
'bodyDocument' => '<string>',
'poll' => [
],
'senderProfileId' => '<string>',
'listId' => '<string>',
'fieldMappings' => [
],
'scheduleType' => '<string>',
'scheduledAt' => '<string>',
'timezone' => '<string>',
'scheduleSettings' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.parallellabs.app/api/v0/marketing-campaigns/{campaignId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"bodyHtml\": \"<string>\",\n \"bodyDocument\": \"<string>\",\n \"poll\": {},\n \"senderProfileId\": \"<string>\",\n \"listId\": \"<string>\",\n \"fieldMappings\": {},\n \"scheduleType\": \"<string>\",\n \"scheduledAt\": \"<string>\",\n \"timezone\": \"<string>\",\n \"scheduleSettings\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.parallellabs.app/api/v0/marketing-campaigns/{campaignId}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"bodyHtml\": \"<string>\",\n \"bodyDocument\": \"<string>\",\n \"poll\": {},\n \"senderProfileId\": \"<string>\",\n \"listId\": \"<string>\",\n \"fieldMappings\": {},\n \"scheduleType\": \"<string>\",\n \"scheduledAt\": \"<string>\",\n \"timezone\": \"<string>\",\n \"scheduleSettings\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.parallellabs.app/api/v0/marketing-campaigns/{campaignId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"bodyHtml\": \"<string>\",\n \"bodyDocument\": \"<string>\",\n \"poll\": {},\n \"senderProfileId\": \"<string>\",\n \"listId\": \"<string>\",\n \"fieldMappings\": {},\n \"scheduleType\": \"<string>\",\n \"scheduledAt\": \"<string>\",\n \"timezone\": \"<string>\",\n \"scheduleSettings\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"companyId": "<string>",
"uid": "<string>",
"name": "<string>",
"subject": "<string>",
"fromName": "<string>",
"replyTo": "<string>",
"bodyHtml": "<string>",
"bodyDocument": "<string>",
"poll": "<string>",
"senderProfileId": "<string>",
"listId": "<string>",
"fieldMappings": {},
"scheduleType": "<string>",
"scheduledAt": "<string>",
"timezone": "<string>",
"status": "<string>",
"sentCount": 123,
"failedCount": 123,
"skippedCount": 123,
"totalRecipients": 123,
"delivered": 123,
"uniqueOpens": 123,
"uniqueClicks": 123,
"hasContent": true,
"startedAt": "<string>",
"completedAt": "<string>",
"created_date": "<string>",
"updated_date": "<string>",
"smartList": {
"id": "<string>",
"name": "<string>"
},
"senderProfile": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"integrationId": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Body
Fields to update (include only fields you want to change)
Request body for updating a marketing campaign (only include fields to change). While sending, name, subject, fromName, replyTo, bodyHtml, bodyDocument, senderProfileId, timezone, and scheduleSettings are editable; recipients and poll definitions are locked. Full editing is available in draft, scheduled, cancelled, or failed status. Sent campaigns are locked.
HTML email body. Supply without bodyDocument for HTML-based campaigns. On update, nonblank HTML replaces the previous body and clears the previous visual-builder document. Empty HTML preserves existing content. For an inline poll, supply the poll field and style anchors with href="{{pollUrl0}}", href="{{pollUrl1}}", etc., one for every option. Use {{pollQuestion}} and {{pollOption0}} etc. for text. See poll for the complete contract.
Visual-builder JSON document for the email body. When supplied, the server renders bodyHtml from this document and it takes precedence over HTML input. Alternatively, supply bodyHtml without a document. Envelope: {"subject": string, "subTitle": string, "content": }. Every node is {"type": string, "attributes": {MJML attributes as string values, e.g. "padding": "10px 25px 10px 25px", "background-color": "#ffffff", "color": "#333333", "font-size": "16px", "align": "center", "width": "600px", "href", "src"}, "data": {"value": {...}}, "children": [...]}; attribute values must be strings (numbers are dropped). Tree: page -> (wrapper | section) -> section -> column -> content blocks. Content block types: "text" (data.value.content = inline HTML string), "image" (attributes.src, alt, href, width), "button" (data.value.content = label, attributes.href), "divider", "spacer" (attributes.height), "social" (data.value.elements = [{src, href, content, target}]), "navbar" (data.value.links = [{href, content}]), "raw" (data.value.content = raw MJML/HTML), plus "hero", "group", "accordion", "carousel" and "table". Each also has an "advanced_" variant (e.g. "advanced_text"), which is what the builder palette inserts; advanced content blocks placed directly under the page or a wrapper are auto-wrapped in a section/column. For a visual poll, insert one marketing_poll block: {"type": "marketing_poll", "data": {"value": {"question": "Your question?", "options": ["Answer one", "Answer two"]}}, "attributes": {}, "children": []}. Its attributes support padding, font-family, font-size, font-weight, color, background-color, button-background-color, button-text-color, button-font-size, and border-radius. The server derives the campaign poll from this block; do not maintain a separate poll definition. Page node: {"type": "page", "attributes": {"background-color": "#efeeea", "width": "600px"}, "data": {"value": {"breakpoint": "480px", "font-family": string, "font-size": "14px", "line-height": "1.7", "font-weight": "400", "text-color": "#000000", "content-background-color": string (optional), "headStyles": [{"content": css, "inline": bool}], "fonts": [{"name", "href"}], "headAttributes": "", "responsive": true}}}. Always set "responsive": true — a missing flag renders a fixed-width layout. Merge tokens pass through rendering untouched: {{content}} inside a text block marks where content-engine output is inserted when content is published as a campaign from this template; Smart-list merge tokens use the matching header normalized to camelCase: for example, First Name becomes {{firstName}} and Company Name becomes {{companyName}}. Tokens are replaced per recipient from the smart-list row; {{unsubscribe}} becomes the per-recipient unsubscribe link.
For HTML-only campaigns, this field is the source of truth for the poll: {"question": "Your question?", "options": ["Answer one", "Answer two"]}. Require a non-empty question and two to six non-empty option strings. In bodyHtml, place {{pollQuestion}} and anchors such as {{pollOption0}} [blocked]. Indices are zero-based and follow options order. Include a quoted href="{{pollUrlN}}" for every option when using any poll token; partial inline polls are rejected. Question/option tokens are replaced with escaped text; URL tokens become per-recipient voting links when sending. Leave tokens intact: never invent or reuse recipient voting URLs. Inline polls suppress the default footer poll. With no poll tokens, a default poll is appended. Update poll and bodyHtml together when changing option count/order; literal HTML labels are not synchronized, so prefer text tokens. Set poll to null and remove all poll tokens from bodyHtml in the same update to remove an HTML poll. A poll-managed bodyDocument takes precedence and derives this field automatically; edit its marketing_poll block instead. Test-email links do not record votes.
Response
The updated marketing campaign
Marketing campaign object
Visual-builder JSON document for the email body. When supplied, the server renders bodyHtml from this document and it takes precedence over HTML input. Alternatively, supply bodyHtml without a document. Envelope: {"subject": string, "subTitle": string, "content": }. Every node is {"type": string, "attributes": {MJML attributes as string values, e.g. "padding": "10px 25px 10px 25px", "background-color": "#ffffff", "color": "#333333", "font-size": "16px", "align": "center", "width": "600px", "href", "src"}, "data": {"value": {...}}, "children": [...]}; attribute values must be strings (numbers are dropped). Tree: page -> (wrapper | section) -> section -> column -> content blocks. Content block types: "text" (data.value.content = inline HTML string), "image" (attributes.src, alt, href, width), "button" (data.value.content = label, attributes.href), "divider", "spacer" (attributes.height), "social" (data.value.elements = [{src, href, content, target}]), "navbar" (data.value.links = [{href, content}]), "raw" (data.value.content = raw MJML/HTML), plus "hero", "group", "accordion", "carousel" and "table". Each also has an "advanced_" variant (e.g. "advanced_text"), which is what the builder palette inserts; advanced content blocks placed directly under the page or a wrapper are auto-wrapped in a section/column. For a visual poll, insert one marketing_poll block: {"type": "marketing_poll", "data": {"value": {"question": "Your question?", "options": ["Answer one", "Answer two"]}}, "attributes": {}, "children": []}. Its attributes support padding, font-family, font-size, font-weight, color, background-color, button-background-color, button-text-color, button-font-size, and border-radius. The server derives the campaign poll from this block; do not maintain a separate poll definition. Page node: {"type": "page", "attributes": {"background-color": "#efeeea", "width": "600px"}, "data": {"value": {"breakpoint": "480px", "font-family": string, "font-size": "14px", "line-height": "1.7", "font-weight": "400", "text-color": "#000000", "content-background-color": string (optional), "headStyles": [{"content": css, "inline": bool}], "fonts": [{"name", "href"}], "headAttributes": "", "responsive": true}}}. Always set "responsive": true — a missing flag renders a fixed-width layout. Merge tokens pass through rendering untouched: {{content}} inside a text block marks where content-engine output is inserted when content is published as a campaign from this template; Smart-list merge tokens use the matching header normalized to camelCase: for example, First Name becomes {{firstName}} and Company Name becomes {{companyName}}. Tokens are replaced per recipient from the smart-list row; {{unsubscribe}} becomes the per-recipient unsubscribe link.

