Campaigns
Update Campaign
Update an existing campaign’s settings, content, or scheduling using the AutoSend API.
PATCH
/
campaigns
/
{campaignId}
curl --request PATCH \
--url 'https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Spring Sale Newsletter - Final",
"subject": "Last chance: Spring Sale ends tonight!",
"previewText": "Up to 50% off — ends at midnight",
"trackingClick": true,
"trackingOpen": true
}'
import requests
url = "https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"name": "Spring Sale Newsletter - Final",
"subject": "Last chance: Spring Sale ends tonight!",
"previewText": "Up to 50% off — ends at midnight",
"trackingClick": True,
"trackingOpen": True
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
const response = await fetch(
'https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567',
{
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Spring Sale Newsletter - Final',
subject: 'Last chance: Spring Sale ends tonight!',
previewText: 'Up to 50% off — ends at midnight',
trackingClick: true,
trackingOpen: true,
}),
}
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Spring Sale Newsletter - Final',
'subject' => 'Last chance: Spring Sale ends tonight!',
'previewText' => 'Up to 50% off — ends at midnight',
'trackingClick' => true,
'trackingOpen' => true,
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer <token>',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
payload := map[string]interface{}{
"name": "Spring Sale Newsletter - Final",
"subject": "Last chance: Spring Sale ends tonight!",
"previewText": "Up to 50% off — ends at midnight",
"trackingClick": true,
"trackingOpen": true,
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("PATCH", "https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
respBody, _ := io.ReadAll(resp.Body)
fmt.Println(string(respBody))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String body = """
{
"name": "Spring Sale Newsletter - Final",
"subject": "Last chance: Spring Sale ends tonight!",
"previewText": "Up to 50% off — ends at midnight",
"trackingClick": true,
"trackingOpen": true
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = {
name: 'Spring Sale Newsletter - Final',
subject: 'Last chance: Spring Sale ends tonight!',
previewText: 'Up to 50% off — ends at midnight',
trackingClick: true,
trackingOpen: true
}.to_json
response = http.request(request)
puts JSON.parse(response.body)
{
"success": true,
"data": {
"id": "60d5ec49f1b2c72d9c8b4567",
"name": "Spring Sale Newsletter - Final",
"subject": "Last chance: Spring Sale ends tonight!",
"previewText": "Up to 50% off — ends at midnight",
"status": "draft",
"sendMode": "immediate",
"trackingClick": true,
"trackingOpen": true,
"createdAt": "2026-03-01T10:00:00.000Z",
"updatedAt": "2026-03-15T14:30:00.000Z"
}
}
curl --request PATCH \
--url 'https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Spring Sale Newsletter - Final",
"subject": "Last chance: Spring Sale ends tonight!",
"previewText": "Up to 50% off — ends at midnight",
"trackingClick": true,
"trackingOpen": true
}'
import requests
url = "https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"name": "Spring Sale Newsletter - Final",
"subject": "Last chance: Spring Sale ends tonight!",
"previewText": "Up to 50% off — ends at midnight",
"trackingClick": True,
"trackingOpen": True
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
const response = await fetch(
'https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567',
{
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Spring Sale Newsletter - Final',
subject: 'Last chance: Spring Sale ends tonight!',
previewText: 'Up to 50% off — ends at midnight',
trackingClick: true,
trackingOpen: true,
}),
}
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Spring Sale Newsletter - Final',
'subject' => 'Last chance: Spring Sale ends tonight!',
'previewText' => 'Up to 50% off — ends at midnight',
'trackingClick' => true,
'trackingOpen' => true,
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer <token>',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
payload := map[string]interface{}{
"name": "Spring Sale Newsletter - Final",
"subject": "Last chance: Spring Sale ends tonight!",
"previewText": "Up to 50% off — ends at midnight",
"trackingClick": true,
"trackingOpen": true,
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("PATCH", "https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
respBody, _ := io.ReadAll(resp.Body)
fmt.Println(string(respBody))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String body = """
{
"name": "Spring Sale Newsletter - Final",
"subject": "Last chance: Spring Sale ends tonight!",
"previewText": "Up to 50% off — ends at midnight",
"trackingClick": true,
"trackingOpen": true
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = {
name: 'Spring Sale Newsletter - Final',
subject: 'Last chance: Spring Sale ends tonight!',
previewText: 'Up to 50% off — ends at midnight',
trackingClick: true,
trackingOpen: true
}.to_json
response = http.request(request)
puts JSON.parse(response.body)
{
"success": true,
"data": {
"id": "60d5ec49f1b2c72d9c8b4567",
"name": "Spring Sale Newsletter - Final",
"subject": "Last chance: Spring Sale ends tonight!",
"previewText": "Up to 50% off — ends at midnight",
"status": "draft",
"sendMode": "immediate",
"trackingClick": true,
"trackingOpen": true,
"createdAt": "2026-03-01T10:00:00.000Z",
"updatedAt": "2026-03-15T14:30:00.000Z"
}
}
Authorizations
string | header
required
Bearer authentication header of the form Bearer
<token>, where <token> is your auth token.Path Parameters
string
required
The id of the campaign to update.
Body
All body fields are optional. Only the fields provided will be updated.string
Display name of the campaign. Between 1 and 200 characters.
string
Email subject line. Between 1 and 998 characters.
string
Preview text shown in email clients. Maximum 200 characters.
object
string
id of a saved sender identity.
string
Reply-to email address. Must be a valid email.
string
ID of the email template to use. The template can be created via the Template API. Either
templateId or htmlTemplate is required.string
Raw HTML content to use as the campaign email body. Either
htmlTemplate or templateId is required. If both are provided, htmlTemplate takes precedence and the template referenced by templateId will be updated with the provided HTML content.array
Array of list or segment IDs to send the campaign to.
array
Array of list or segment IDs to exclude from sending.
string
ID of the unsubscribe group to associate with this campaign.
boolean
If
true, triggers sending immediately.string
ISO 8601 date-time string at which to schedule the campaign for sending.
boolean
If
true, send to all contacts in the global list.boolean
If
true, publishes and finalizes the campaign.boolean
Enable or disable click tracking.
boolean
Enable or disable open tracking.
string
Delivery mode. One of:
immediate, scheduled, gradual.string
Growth strategy for gradual sending. One of:
fixed, 1.25x, 1.5x, 1.75x, 2x.integer
Number of emails to send per day in gradual mode. Must be at least
1.string
Timezone string for scheduled or gradual sending.
Response
Returns the updated campaign object.boolean
Indicates whether the request was successful.
object
The updated campaign object.
Show data
Show data
string
Unique identifier of the campaign.
string
Updated display name.
string
Updated subject line.
string
Updated preview text.
string
Current status of the campaign.
string
Delivery mode:
immediate, scheduled, or gradual.boolean
Whether click tracking is enabled.
boolean
Whether open tracking is enabled.
string
ISO 8601 timestamp when the campaign was created.
string
ISO 8601 timestamp when the campaign was last updated.
Was this page helpful?
⌘I
curl --request PATCH \
--url 'https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Spring Sale Newsletter - Final",
"subject": "Last chance: Spring Sale ends tonight!",
"previewText": "Up to 50% off — ends at midnight",
"trackingClick": true,
"trackingOpen": true
}'
import requests
url = "https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"name": "Spring Sale Newsletter - Final",
"subject": "Last chance: Spring Sale ends tonight!",
"previewText": "Up to 50% off — ends at midnight",
"trackingClick": True,
"trackingOpen": True
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
const response = await fetch(
'https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567',
{
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Spring Sale Newsletter - Final',
subject: 'Last chance: Spring Sale ends tonight!',
previewText: 'Up to 50% off — ends at midnight',
trackingClick: true,
trackingOpen: true,
}),
}
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Spring Sale Newsletter - Final',
'subject' => 'Last chance: Spring Sale ends tonight!',
'previewText' => 'Up to 50% off — ends at midnight',
'trackingClick' => true,
'trackingOpen' => true,
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer <token>',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
payload := map[string]interface{}{
"name": "Spring Sale Newsletter - Final",
"subject": "Last chance: Spring Sale ends tonight!",
"previewText": "Up to 50% off — ends at midnight",
"trackingClick": true,
"trackingOpen": true,
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("PATCH", "https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
respBody, _ := io.ReadAll(resp.Body)
fmt.Println(string(respBody))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String body = """
{
"name": "Spring Sale Newsletter - Final",
"subject": "Last chance: Spring Sale ends tonight!",
"previewText": "Up to 50% off — ends at midnight",
"trackingClick": true,
"trackingOpen": true
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = {
name: 'Spring Sale Newsletter - Final',
subject: 'Last chance: Spring Sale ends tonight!',
previewText: 'Up to 50% off — ends at midnight',
trackingClick: true,
trackingOpen: true
}.to_json
response = http.request(request)
puts JSON.parse(response.body)
{
"success": true,
"data": {
"id": "60d5ec49f1b2c72d9c8b4567",
"name": "Spring Sale Newsletter - Final",
"subject": "Last chance: Spring Sale ends tonight!",
"previewText": "Up to 50% off — ends at midnight",
"status": "draft",
"sendMode": "immediate",
"trackingClick": true,
"trackingOpen": true,
"createdAt": "2026-03-01T10:00:00.000Z",
"updatedAt": "2026-03-15T14:30:00.000Z"
}
}