Update Campaign
curl --request PATCH \
--url https://api.example.com/v1/campaigns/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"daily_send_limit": 123,
"delay_between_emails": 123,
"sending_timezone": "<string>",
"send_on_weekends": true,
"track_opens": true,
"track_clicks": true,
"show_unsubscribe": true
}
'import requests
url = "https://api.example.com/v1/campaigns/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"daily_send_limit": 123,
"delay_between_emails": 123,
"sending_timezone": "<string>",
"send_on_weekends": True,
"track_opens": True,
"track_clicks": True,
"show_unsubscribe": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
daily_send_limit: 123,
delay_between_emails: 123,
sending_timezone: '<string>',
send_on_weekends: true,
track_opens: true,
track_clicks: true,
show_unsubscribe: true
})
};
fetch('https://api.example.com/v1/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://api.example.com/v1/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' => '<string>',
'description' => '<string>',
'daily_send_limit' => 123,
'delay_between_emails' => 123,
'sending_timezone' => '<string>',
'send_on_weekends' => true,
'track_opens' => true,
'track_clicks' => true,
'show_unsubscribe' => true
]),
CURLOPT_HTTPHEADER => [
"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.example.com/v1/campaigns/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"daily_send_limit\": 123,\n \"delay_between_emails\": 123,\n \"sending_timezone\": \"<string>\",\n \"send_on_weekends\": true,\n \"track_opens\": true,\n \"track_clicks\": true,\n \"show_unsubscribe\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.example.com/v1/campaigns/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"daily_send_limit\": 123,\n \"delay_between_emails\": 123,\n \"sending_timezone\": \"<string>\",\n \"send_on_weekends\": true,\n \"track_opens\": true,\n \"track_clicks\": true,\n \"show_unsubscribe\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/campaigns/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"daily_send_limit\": 123,\n \"delay_between_emails\": 123,\n \"sending_timezone\": \"<string>\",\n \"send_on_weekends\": true,\n \"track_opens\": true,\n \"track_clicks\": true,\n \"show_unsubscribe\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"campaign": {}
}
}Campaigns
Update Campaign
Modify campaign settings such as send limits, tracking, and timezone
PATCH
/
v1
/
campaigns
/
{id}
Update Campaign
curl --request PATCH \
--url https://api.example.com/v1/campaigns/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"daily_send_limit": 123,
"delay_between_emails": 123,
"sending_timezone": "<string>",
"send_on_weekends": true,
"track_opens": true,
"track_clicks": true,
"show_unsubscribe": true
}
'import requests
url = "https://api.example.com/v1/campaigns/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"daily_send_limit": 123,
"delay_between_emails": 123,
"sending_timezone": "<string>",
"send_on_weekends": True,
"track_opens": True,
"track_clicks": True,
"show_unsubscribe": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
daily_send_limit: 123,
delay_between_emails: 123,
sending_timezone: '<string>',
send_on_weekends: true,
track_opens: true,
track_clicks: true,
show_unsubscribe: true
})
};
fetch('https://api.example.com/v1/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://api.example.com/v1/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' => '<string>',
'description' => '<string>',
'daily_send_limit' => 123,
'delay_between_emails' => 123,
'sending_timezone' => '<string>',
'send_on_weekends' => true,
'track_opens' => true,
'track_clicks' => true,
'show_unsubscribe' => true
]),
CURLOPT_HTTPHEADER => [
"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.example.com/v1/campaigns/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"daily_send_limit\": 123,\n \"delay_between_emails\": 123,\n \"sending_timezone\": \"<string>\",\n \"send_on_weekends\": true,\n \"track_opens\": true,\n \"track_clicks\": true,\n \"show_unsubscribe\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.example.com/v1/campaigns/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"daily_send_limit\": 123,\n \"delay_between_emails\": 123,\n \"sending_timezone\": \"<string>\",\n \"send_on_weekends\": true,\n \"track_opens\": true,\n \"track_clicks\": true,\n \"show_unsubscribe\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/campaigns/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"daily_send_limit\": 123,\n \"delay_between_emails\": 123,\n \"sending_timezone\": \"<string>\",\n \"send_on_weekends\": true,\n \"track_opens\": true,\n \"track_clicks\": true,\n \"show_unsubscribe\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"campaign": {}
}
}Request
Path Parameters
string
required
The campaign’s unique ID (UUID)
Headers
Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Requires an API key with the
campaigns:write permission. All body fields are optional — include only fields you want to change.Body Parameters
string
Campaign name
string
Free-form description
integer
Maximum emails to send per day (1–500)
integer
Seconds to wait between sends within a day (min 30)
string
IANA timezone (e.g.,
Europe/Berlin, America/New_York)boolean
Whether sends are allowed on Saturday and Sunday
boolean
Enable open tracking
boolean
Enable click tracking
boolean
Append unsubscribe footer (recommended; required in some jurisdictions)
Response
curl -X PATCH https://data.leadlex.com/functions/v1/api-gateway/v1/campaigns/cmp_abc123 \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"daily_send_limit": 75,
"send_on_weekends": false
}'
import requests
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
CAMPAIGN_ID = "cmp_abc123"
response = requests.patch(
f"{BASE_URL}/v1/campaigns/{CAMPAIGN_ID}",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
json={"daily_send_limit": 75, "send_on_weekends": False},
)
const CAMPAIGN_ID = 'cmp_abc123';
const response = await fetch(
`https://data.leadlex.com/functions/v1/api-gateway/v1/campaigns/${CAMPAIGN_ID}`,
{
method: 'PATCH',
headers: {
'Authorization': 'Bearer wbk_your_api_key_here',
'Content-Type': 'application/json',
},
body: JSON.stringify({ daily_send_limit: 75, send_on_weekends: false }),
}
);
Example Response
{
"data": {
"campaign": {
"id": "cmp_abc123",
"name": "Q2 GC Outreach",
"daily_send_limit": 75,
"send_on_weekends": false,
"updated_at": "2026-04-17T14:30:00Z"
}
}
}
Errors
| Status | Code | Description |
|---|---|---|
| 400 | invalid_timezone | sending_timezone is not a valid IANA zone |
| 400 | invalid_send_limit | daily_send_limit out of range (1–500) |
| 401 | invalid_key | Invalid or expired API key |
| 403 | insufficient_permissions | Missing campaigns:write permission |
| 404 | campaign_not_found | No campaign with this ID |
| 429 | rate_limited | Rate limit exceeded |