curl --request POST \
--url https://api.naturalead.ai/api/campaigns \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"agentConfigId": "<string>",
"channel": "whatsapp",
"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"
payload = {
"name": "<string>",
"agentConfigId": "<string>",
"channel": "whatsapp",
"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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
agentConfigId: '<string>',
channel: 'whatsapp',
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', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'agentConfigId' => '<string>',
'channel' => 'whatsapp',
'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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"agentConfigId\": \"<string>\",\n \"channel\": \"whatsapp\",\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("POST", 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.post("https://api.naturalead.ai/api/campaigns")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"agentConfigId\": \"<string>\",\n \"channel\": \"whatsapp\",\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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"agentConfigId\": \"<string>\",\n \"channel\": \"whatsapp\",\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": "Failed to process request"
}Create Campaign
Creates a new campaign in draft status. The campaign must reference a valid
agent configuration and optionally include lead filters, scheduling, and
channel settings. Requires campaigns:create permission.
curl --request POST \
--url https://api.naturalead.ai/api/campaigns \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"agentConfigId": "<string>",
"channel": "whatsapp",
"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"
payload = {
"name": "<string>",
"agentConfigId": "<string>",
"channel": "whatsapp",
"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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
agentConfigId: '<string>',
channel: 'whatsapp',
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', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'agentConfigId' => '<string>',
'channel' => 'whatsapp',
'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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"agentConfigId\": \"<string>\",\n \"channel\": \"whatsapp\",\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("POST", 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.post("https://api.naturalead.ai/api/campaigns")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"agentConfigId\": \"<string>\",\n \"channel\": \"whatsapp\",\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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"agentConfigId\": \"<string>\",\n \"channel\": \"whatsapp\",\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": "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.
Body
Request body for creating a new campaign.
Campaign display name
ID of the agent configuration to use for conversations
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 created 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