Update campaign
curl --request PATCH \
--url https://app.nicecall.ai/api/user/campaign/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.nicecall.ai/api/user/campaign/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.nicecall.ai/api/user/campaign/{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://app.nicecall.ai/api/user/campaign/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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://app.nicecall.ai/api/user/campaign/{id}"
req, _ := http.NewRequest("PATCH", 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.patch("https://app.nicecall.ai/api/user/campaign/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.nicecall.ai/api/user/campaign/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyCampaigns
Update campaign
Update campaign with the Nicecall API.
PATCH
/
user
/
campaign
/
{id}
Update campaign
curl --request PATCH \
--url https://app.nicecall.ai/api/user/campaign/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.nicecall.ai/api/user/campaign/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.nicecall.ai/api/user/campaign/{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://app.nicecall.ai/api/user/campaign/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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://app.nicecall.ai/api/user/campaign/{id}"
req, _ := http.NewRequest("PATCH", 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.patch("https://app.nicecall.ai/api/user/campaign/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.nicecall.ai/api/user/campaign/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyUpdate a campaign you own, including one that is running. Send only the fields you want to change. Arrays such as
Use an IANA timezone such as
The response includes the updated campaign in
schedule_windows, allowed_days, and phone_number_ids replace the existing lists. The campaign’s channel is fixed. Use Update campaign status to start or stop it.
ID from Get campaign.
| Applies to | Editable fields |
|---|---|
| All channels | name, timezone, schedule_windows, scheduled_start_at, mark_complete_when_no_leads |
| Legacy schedule | allowed_hours_start_time, allowed_hours_end_time, allowed_days |
| Calls | assistant_id, phone_number_ids, max_calls_in_parallel, max_retries, retry_interval, retry_on_voicemail, retry_on_goal_incomplete, goal_completion_variable |
| Call fallback | fallback_channel, fallback_whatsapp_sender_id, fallback_whatsapp_template_id, fallback_variable_mapping, fallback_sms_from_phone_number_id, fallback_sms_body |
whatsapp_sender_id, whatsapp_template_id, text_variable_mapping, messages_per_minute | |
| SMS | sms_from_phone_number_id, sms_body, messages_per_minute |
America/New_York. An ISO 8601 scheduled_start_at without an offset is interpreted in the campaign timezone. Send null to clear it. Assigning a different outbound assistant can also change the timezone unless you supply one explicitly. When replacing a WhatsApp template, map all its placeholders to lead variables.
curl --request PATCH 'https://app.nicecall.ai/api/user/campaign/123' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{"name":"Appointment follow-ups","timezone":"America/New_York"}'
data. A 422 response identifies invalid fields or settings that conflict with the current campaign configuration.
