curl --request PATCH \
--url https://api.naturalead.ai/api/campaigns/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"agentConfigId": "<string>",
"leadFilter": {
"statuses": [
"<string>"
],
"tags": [
"<string>"
],
"importedAfter": "2023-11-07T05:31:56Z"
},
"manualLeadIds": [
"<string>"
],
"schedule": {
"startAt": "2023-11-07T05:31:56Z",
"rateLimit": 5,
"activeDays": [
1,
2,
3,
4,
5
]
}
}
'import requests
url = "https://api.naturalead.ai/api/campaigns/{id}"
payload = {
"name": "<string>",
"agentConfigId": "<string>",
"leadFilter": {
"statuses": ["<string>"],
"tags": ["<string>"],
"importedAfter": "2023-11-07T05:31:56Z"
},
"manualLeadIds": ["<string>"],
"schedule": {
"startAt": "2023-11-07T05:31:56Z",
"rateLimit": 5,
"activeDays": [1, 2, 3, 4, 5]
}
}
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>',
agentConfigId: '<string>',
leadFilter: {
statuses: ['<string>'],
tags: ['<string>'],
importedAfter: '2023-11-07T05:31:56Z'
},
manualLeadIds: ['<string>'],
schedule: {startAt: '2023-11-07T05:31:56Z', rateLimit: 5, activeDays: [1, 2, 3, 4, 5]}
})
};
fetch('https://api.naturalead.ai/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://api.naturalead.ai/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' => '<string>',
'agentConfigId' => '<string>',
'leadFilter' => [
'statuses' => [
'<string>'
],
'tags' => [
'<string>'
],
'importedAfter' => '2023-11-07T05:31:56Z'
],
'manualLeadIds' => [
'<string>'
],
'schedule' => [
'startAt' => '2023-11-07T05:31:56Z',
'rateLimit' => 5,
'activeDays' => [
1,
2,
3,
4,
5
]
]
]),
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.naturalead.ai/api/campaigns/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"agentConfigId\": \"<string>\",\n \"leadFilter\": {\n \"statuses\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"importedAfter\": \"2023-11-07T05:31:56Z\"\n },\n \"manualLeadIds\": [\n \"<string>\"\n ],\n \"schedule\": {\n \"startAt\": \"2023-11-07T05:31:56Z\",\n \"rateLimit\": 5,\n \"activeDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ]\n }\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.naturalead.ai/api/campaigns/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"agentConfigId\": \"<string>\",\n \"leadFilter\": {\n \"statuses\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"importedAfter\": \"2023-11-07T05:31:56Z\"\n },\n \"manualLeadIds\": [\n \"<string>\"\n ],\n \"schedule\": {\n \"startAt\": \"2023-11-07T05:31:56Z\",\n \"rateLimit\": 5,\n \"activeDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/campaigns/{id}")
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 \"agentConfigId\": \"<string>\",\n \"leadFilter\": {\n \"statuses\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"importedAfter\": \"2023-11-07T05:31:56Z\"\n },\n \"manualLeadIds\": [\n \"<string>\"\n ],\n \"schedule\": {\n \"startAt\": \"2023-11-07T05:31:56Z\",\n \"rateLimit\": 5,\n \"activeDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"accountId": "<string>",
"name": "<string>",
"agentConfigId": "<string>",
"channel": "whatsapp",
"status": "draft",
"schedule": {
"startAt": "2023-11-07T05:31:56Z",
"rateLimit": 5,
"activeHours": {
"start": "09:00",
"end": "17:00",
"timezone": "America/New_York"
},
"activeDays": [
1,
2,
3,
4,
5
]
},
"leads": [
{
"leadId": "<string>",
"status": "pending",
"conversationId": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"error": "<string>"
}
],
"stats": {
"totalLeads": 0,
"sent": 0,
"delivered": 0,
"replied": 0,
"qualified": 0,
"disqualified": 0,
"failed": 0
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"leadFilter": {
"statuses": [
"<string>"
],
"tags": [
"<string>"
],
"importedAfter": "2023-11-07T05:31:56Z"
},
"advancedFilter": {
"conditions": [
{
"field": "<string>",
"operator": "<string>",
"value": "<unknown>"
}
]
},
"manualLeadIds": [
"<string>"
]
}{
"error": "name is required"
}{
"error": "Campaign not found or not in draft status"
}{
"error": "Failed to process request"
}Update Campaign
Updates a campaign that is in draft status. Only draft campaigns can be
modified. Requires campaigns:edit permission.
curl --request PATCH \
--url https://api.naturalead.ai/api/campaigns/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"agentConfigId": "<string>",
"leadFilter": {
"statuses": [
"<string>"
],
"tags": [
"<string>"
],
"importedAfter": "2023-11-07T05:31:56Z"
},
"manualLeadIds": [
"<string>"
],
"schedule": {
"startAt": "2023-11-07T05:31:56Z",
"rateLimit": 5,
"activeDays": [
1,
2,
3,
4,
5
]
}
}
'import requests
url = "https://api.naturalead.ai/api/campaigns/{id}"
payload = {
"name": "<string>",
"agentConfigId": "<string>",
"leadFilter": {
"statuses": ["<string>"],
"tags": ["<string>"],
"importedAfter": "2023-11-07T05:31:56Z"
},
"manualLeadIds": ["<string>"],
"schedule": {
"startAt": "2023-11-07T05:31:56Z",
"rateLimit": 5,
"activeDays": [1, 2, 3, 4, 5]
}
}
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>',
agentConfigId: '<string>',
leadFilter: {
statuses: ['<string>'],
tags: ['<string>'],
importedAfter: '2023-11-07T05:31:56Z'
},
manualLeadIds: ['<string>'],
schedule: {startAt: '2023-11-07T05:31:56Z', rateLimit: 5, activeDays: [1, 2, 3, 4, 5]}
})
};
fetch('https://api.naturalead.ai/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://api.naturalead.ai/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' => '<string>',
'agentConfigId' => '<string>',
'leadFilter' => [
'statuses' => [
'<string>'
],
'tags' => [
'<string>'
],
'importedAfter' => '2023-11-07T05:31:56Z'
],
'manualLeadIds' => [
'<string>'
],
'schedule' => [
'startAt' => '2023-11-07T05:31:56Z',
'rateLimit' => 5,
'activeDays' => [
1,
2,
3,
4,
5
]
]
]),
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.naturalead.ai/api/campaigns/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"agentConfigId\": \"<string>\",\n \"leadFilter\": {\n \"statuses\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"importedAfter\": \"2023-11-07T05:31:56Z\"\n },\n \"manualLeadIds\": [\n \"<string>\"\n ],\n \"schedule\": {\n \"startAt\": \"2023-11-07T05:31:56Z\",\n \"rateLimit\": 5,\n \"activeDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ]\n }\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.naturalead.ai/api/campaigns/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"agentConfigId\": \"<string>\",\n \"leadFilter\": {\n \"statuses\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"importedAfter\": \"2023-11-07T05:31:56Z\"\n },\n \"manualLeadIds\": [\n \"<string>\"\n ],\n \"schedule\": {\n \"startAt\": \"2023-11-07T05:31:56Z\",\n \"rateLimit\": 5,\n \"activeDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/campaigns/{id}")
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 \"agentConfigId\": \"<string>\",\n \"leadFilter\": {\n \"statuses\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"importedAfter\": \"2023-11-07T05:31:56Z\"\n },\n \"manualLeadIds\": [\n \"<string>\"\n ],\n \"schedule\": {\n \"startAt\": \"2023-11-07T05:31:56Z\",\n \"rateLimit\": 5,\n \"activeDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"accountId": "<string>",
"name": "<string>",
"agentConfigId": "<string>",
"channel": "whatsapp",
"status": "draft",
"schedule": {
"startAt": "2023-11-07T05:31:56Z",
"rateLimit": 5,
"activeHours": {
"start": "09:00",
"end": "17:00",
"timezone": "America/New_York"
},
"activeDays": [
1,
2,
3,
4,
5
]
},
"leads": [
{
"leadId": "<string>",
"status": "pending",
"conversationId": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"error": "<string>"
}
],
"stats": {
"totalLeads": 0,
"sent": 0,
"delivered": 0,
"replied": 0,
"qualified": 0,
"disqualified": 0,
"failed": 0
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"leadFilter": {
"statuses": [
"<string>"
],
"tags": [
"<string>"
],
"importedAfter": "2023-11-07T05:31:56Z"
},
"advancedFilter": {
"conditions": [
{
"field": "<string>",
"operator": "<string>",
"value": "<unknown>"
}
]
},
"manualLeadIds": [
"<string>"
]
}{
"error": "name is required"
}{
"error": "Campaign not found or not in draft status"
}{
"error": "Failed to process request"
}Authorizations
API key for programmatic access. Keys use the format nl_live_<64 hex>
or nl_test_<64 hex> and are scoped to an account's RBAC permissions.
Path Parameters
Campaign ID (MongoDB ObjectId)
"665a1b2c3d4e5f6a7b8c9d0e"
Body
Request body for updating a draft campaign. All fields are optional; only provided fields will be updated.
Campaign display name
ID of the agent configuration to use
Messaging channel for outreach
whatsapp, telegram, email Basic lead filter criteria.
Show child attributes
Show child attributes
Advanced filter with multiple conditions.
Show child attributes
Show child attributes
Explicitly selected lead IDs to include
Campaign scheduling and rate limit configuration.
Show child attributes
Show child attributes
Response
Campaign updated successfully
A campaign orchestrates batch AI-driven outreach to leads.
Unique campaign identifier
Account that owns this campaign
Campaign display name
Reference to the AI agent configuration used for conversations
Messaging channel for outreach
whatsapp, telegram, email Current campaign lifecycle status
draft, scheduled, running, paused, completed Campaign scheduling and rate limit configuration.
Show child attributes
Show child attributes
Per-lead tracking for the campaign
Show child attributes
Show child attributes
Aggregate statistics for the campaign.
Show child attributes
Show child attributes
Basic lead filter criteria.
Show child attributes
Show child attributes
Advanced filter with multiple conditions.
Show child attributes
Show child attributes
Explicitly selected lead IDs to include in the campaign