curl --request PATCH \
--url https://your-instance.example.com/api/campaigns/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Q2 Lead Gen (revised)",
"message": "Hi {{firstName}}, quick follow-up — let me know if a 10-min call works.",
"scheduleDate": "2026-05-22T16:00:00.000Z",
"isAutopilot": false
}
'import requests
url = "https://your-instance.example.com/api/campaigns/{id}"
payload = {
"name": "Q2 Lead Gen (revised)",
"message": "Hi {{firstName}}, quick follow-up — let me know if a 10-min call works.",
"scheduleDate": "2026-05-22T16:00:00.000Z",
"isAutopilot": False
}
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({
name: 'Q2 Lead Gen (revised)',
message: 'Hi {{firstName}}, quick follow-up — let me know if a 10-min call works.',
scheduleDate: '2026-05-22T16:00:00.000Z',
isAutopilot: false
})
};
fetch('https://your-instance.example.com/api/campaigns/{id}', 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://your-instance.example.com/api/campaigns/{id}",
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' => 'Q2 Lead Gen (revised)',
'message' => 'Hi {{firstName}}, quick follow-up — let me know if a 10-min call works.',
'scheduleDate' => '2026-05-22T16:00:00.000Z',
'isAutopilot' => false
]),
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://your-instance.example.com/api/campaigns/{id}"
payload := strings.NewReader("{\n \"name\": \"Q2 Lead Gen (revised)\",\n \"message\": \"Hi {{firstName}}, quick follow-up — let me know if a 10-min call works.\",\n \"scheduleDate\": \"2026-05-22T16:00:00.000Z\",\n \"isAutopilot\": false\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://your-instance.example.com/api/campaigns/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Q2 Lead Gen (revised)\",\n \"message\": \"Hi {{firstName}}, quick follow-up — let me know if a 10-min call works.\",\n \"scheduleDate\": \"2026-05-22T16:00:00.000Z\",\n \"isAutopilot\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/campaigns/{id}")
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 \"name\": \"Q2 Lead Gen (revised)\",\n \"message\": \"Hi {{firstName}}, quick follow-up — let me know if a 10-min call works.\",\n \"scheduleDate\": \"2026-05-22T16:00:00.000Z\",\n \"isAutopilot\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Campaign created",
"data": {
"_id": "665f1a0c0e0a4b001a2c9f10",
"name": "Q2 Lead Gen",
"status": "scheduled",
"scheduleDate": "2026-05-20T15:00:00.000Z"
}
}{
"success": false,
"message": "Validation error",
"error": "name is required"
}{
"success": false,
"message": "Validation error",
"error": "name is required"
}{
"success": false,
"message": "Validation error",
"error": "name is required"
}Update a scheduled campaign
Updates name, message, scheduleDate, autopilot flag, status, or per-segment overrides on a scheduled campaign. Cannot modify campaigns that have already been sent.
curl --request PATCH \
--url https://your-instance.example.com/api/campaigns/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Q2 Lead Gen (revised)",
"message": "Hi {{firstName}}, quick follow-up — let me know if a 10-min call works.",
"scheduleDate": "2026-05-22T16:00:00.000Z",
"isAutopilot": false
}
'import requests
url = "https://your-instance.example.com/api/campaigns/{id}"
payload = {
"name": "Q2 Lead Gen (revised)",
"message": "Hi {{firstName}}, quick follow-up — let me know if a 10-min call works.",
"scheduleDate": "2026-05-22T16:00:00.000Z",
"isAutopilot": False
}
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({
name: 'Q2 Lead Gen (revised)',
message: 'Hi {{firstName}}, quick follow-up — let me know if a 10-min call works.',
scheduleDate: '2026-05-22T16:00:00.000Z',
isAutopilot: false
})
};
fetch('https://your-instance.example.com/api/campaigns/{id}', 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://your-instance.example.com/api/campaigns/{id}",
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' => 'Q2 Lead Gen (revised)',
'message' => 'Hi {{firstName}}, quick follow-up — let me know if a 10-min call works.',
'scheduleDate' => '2026-05-22T16:00:00.000Z',
'isAutopilot' => false
]),
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://your-instance.example.com/api/campaigns/{id}"
payload := strings.NewReader("{\n \"name\": \"Q2 Lead Gen (revised)\",\n \"message\": \"Hi {{firstName}}, quick follow-up — let me know if a 10-min call works.\",\n \"scheduleDate\": \"2026-05-22T16:00:00.000Z\",\n \"isAutopilot\": false\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://your-instance.example.com/api/campaigns/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Q2 Lead Gen (revised)\",\n \"message\": \"Hi {{firstName}}, quick follow-up — let me know if a 10-min call works.\",\n \"scheduleDate\": \"2026-05-22T16:00:00.000Z\",\n \"isAutopilot\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/campaigns/{id}")
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 \"name\": \"Q2 Lead Gen (revised)\",\n \"message\": \"Hi {{firstName}}, quick follow-up — let me know if a 10-min call works.\",\n \"scheduleDate\": \"2026-05-22T16:00:00.000Z\",\n \"isAutopilot\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Campaign created",
"data": {
"_id": "665f1a0c0e0a4b001a2c9f10",
"name": "Q2 Lead Gen",
"status": "scheduled",
"scheduleDate": "2026-05-20T15:00:00.000Z"
}
}{
"success": false,
"message": "Validation error",
"error": "name is required"
}{
"success": false,
"message": "Validation error",
"error": "name is required"
}{
"success": false,
"message": "Validation error",
"error": "name is required"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Campaign display name shown in the campaigns list.
SMS body used when isAutopilot is false; supports {{firstName}}-style placeholders.
ISO timestamp when the campaign should fire; null sends immediately.
When true, the AI prompt drives the campaign instead of using the message body verbatim.
Prompt _id used to drive AI replies for this campaign.
Lifecycle status: scheduled, sent, failed, partial success, or cancelled.
Per-segment overrides keyed by stage _id.
Per-segment overrides keyed by stage _id.
Per-segment overrides keyed by stage _id.
Response
Campaign updated
Show child attributes
Show child attributes
{
"_id": "665f1a0c0e0a4b001a2c9f10",
"organizationId": "64ee9a8b1e7f2a0011223344",
"name": "Q2 Lead Gen",
"message": "Hi {{firstName}}, are you still interested in a quote?",
"userIds": ["64ee9a8b1e7f2a0011223399"],
"scheduleDate": "2026-05-20T15:00:00.000Z",
"process": "64eea1110000000000000001",
"contactStatus": "New Lead",
"isAutopilot": false,
"type": "sms",
"status": "scheduled",
"createdBy": {
"_id": "64ee9a8b1e7f2a0011223399",
"fullName": "Alex Rep"
},
"failedUserIds": [],
"failedDetails": [],
"stats": {
"total": 250,
"sent": 0,
"failed": 0,
"successRate": "0%"
},
"createdAt": "2026-05-18T12:34:56.000Z",
"updatedAt": "2026-05-18T12:34:56.000Z"
}