curl -X GET "https://server.smartlead.ai/api/v1/campaigns/?api_key=YOUR_API_KEY&include_tags=true"
import requests
API_KEY = "YOUR_API_KEY"
url = "https://server.smartlead.ai/api/v1/campaigns/"
response = requests.get(
url,
params={
"api_key": API_KEY,
"include_tags": True
}
)
campaigns = response.json()
print(f"Total campaigns: {len(campaigns['campaigns'])}")
const API_KEY = 'YOUR_API_KEY';
async function getAllCampaigns() {
const response = await fetch(
`https://server.smartlead.ai/api/v1/campaigns/?api_key=${API_KEY}&include_tags=true`
);
const data = await response.json();
return data.campaigns;
}
getAllCampaigns().then(campaigns => {
console.log(`Found ${campaigns.length} campaigns`);
});
<?php
$api_key = 'YOUR_API_KEY';
$url = 'https://server.smartlead.ai/api/v1/campaigns/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "$url?api_key=$api_key&include_tags=true");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
echo "Total campaigns: " . count($data['campaigns']);
?>
[
{
"id": 2710262,
"user_id": 196026,
"created_at": "2025-11-25T10:43:46.826Z",
"updated_at": "2025-11-25T14:02:21.776Z",
"status": "ACTIVE",
"name": "Cold Outreach Q1 2024",
"track_settings": ["DONT_EMAIL_OPEN", "DONT_LINK_CLICK"],
"scheduler_cron_value": {
"tz": "America/New_York",
"days": [1, 2, 3, 4, 5],
"endHour": "19:00",
"startHour": "09:00"
},
"min_time_btwn_emails": 24,
"max_leads_per_day": 100,
"stop_lead_settings": "REPLY_TO_AN_EMAIL",
"schedule_start_time": null,
"enable_ai_esp_matching": true,
"send_as_plain_text": false,
"follow_up_percentage": 20,
"unsubscribe_text": "",
"parent_campaign_id": null,
"client_id": null,
"tags": [
{
"tag_id": 1,
"tag_name": "Q1",
"tag_color": "#FF5733"
}
]
}
]
Response Format: This endpoint returns a direct array of campaigns, not wrapped in a success object. Each campaign contains comprehensive configuration including schedule, tracking settings, AI preferences, and sending limits.
{
"message": "Invalid API Key"
}
{
"error": "Resource not found"
}
{
"error": "Invalid parameters provided"
}
Campaign Management
Get All Campaigns
Retrieves all email campaigns for the authenticated user with comprehensive campaign data including status, schedule set
GET
/
api
/
v1
/
campaigns
/
curl -X GET "https://server.smartlead.ai/api/v1/campaigns/?api_key=YOUR_API_KEY&include_tags=true"
import requests
API_KEY = "YOUR_API_KEY"
url = "https://server.smartlead.ai/api/v1/campaigns/"
response = requests.get(
url,
params={
"api_key": API_KEY,
"include_tags": True
}
)
campaigns = response.json()
print(f"Total campaigns: {len(campaigns['campaigns'])}")
const API_KEY = 'YOUR_API_KEY';
async function getAllCampaigns() {
const response = await fetch(
`https://server.smartlead.ai/api/v1/campaigns/?api_key=${API_KEY}&include_tags=true`
);
const data = await response.json();
return data.campaigns;
}
getAllCampaigns().then(campaigns => {
console.log(`Found ${campaigns.length} campaigns`);
});
<?php
$api_key = 'YOUR_API_KEY';
$url = 'https://server.smartlead.ai/api/v1/campaigns/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "$url?api_key=$api_key&include_tags=true");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
echo "Total campaigns: " . count($data['campaigns']);
?>
[
{
"id": 2710262,
"user_id": 196026,
"created_at": "2025-11-25T10:43:46.826Z",
"updated_at": "2025-11-25T14:02:21.776Z",
"status": "ACTIVE",
"name": "Cold Outreach Q1 2024",
"track_settings": ["DONT_EMAIL_OPEN", "DONT_LINK_CLICK"],
"scheduler_cron_value": {
"tz": "America/New_York",
"days": [1, 2, 3, 4, 5],
"endHour": "19:00",
"startHour": "09:00"
},
"min_time_btwn_emails": 24,
"max_leads_per_day": 100,
"stop_lead_settings": "REPLY_TO_AN_EMAIL",
"schedule_start_time": null,
"enable_ai_esp_matching": true,
"send_as_plain_text": false,
"follow_up_percentage": 20,
"unsubscribe_text": "",
"parent_campaign_id": null,
"client_id": null,
"tags": [
{
"tag_id": 1,
"tag_name": "Q1",
"tag_color": "#FF5733"
}
]
}
]
Response Format: This endpoint returns a direct array of campaigns, not wrapped in a success object. Each campaign contains comprehensive configuration including schedule, tracking settings, AI preferences, and sending limits.
{
"message": "Invalid API Key"
}
{
"error": "Resource not found"
}
{
"error": "Invalid parameters provided"
}
Retrieves all email campaigns for the authenticated user with comprehensive campaign data including status, schedule settings, tracking configuration, AI matching preferences, and sending limits Essential for dashboard displays, campaign selection interfaces, and bulk operations across portfolio.
Overview
Retrieves all email campaigns for the authenticated user with comprehensive campaign data including status, schedule settings, tracking configuration, AI matching preferences, and sending limits Key Features:- Returns campaigns ordered by ID descending (newest first)
- Supports optional client_id filtering for agency/white-label accounts managing multiple clients
- When include_tags=true, returns campaign tags with tag IDs, names, and colors for categorization and filtering
- Returns direct array of campaign objects (not wrapped)
Query Parameters
string
required
Your SmartLead API key
number
Filter campaigns by specific client ID
boolean
default:"false"
Include campaign tags in the response
Response
boolean
Indicates if the request was successful
array
Array of campaign objects
Show Campaign Object Fields
Show Campaign Object Fields
number
Unique campaign identifier
number
ID of the user who owns this campaign
string
Campaign name set by user
string
Current campaign status:
ACTIVE, PAUSED, STOPPED, ARCHIVED, DRAFTEDstring
ISO 8601 timestamp when campaign was created
string
ISO 8601 timestamp of last modification
array
Tracking configuration. Array can contain:
"DONT_EMAIL_OPEN"- Disable open tracking"DONT_LINK_CLICK"- Disable click tracking- Empty array
[]- Track everything
object
number
Minimum minutes to wait between consecutive emails. Higher values (120+) appear more natural and improve deliverability.
number
Maximum number of leads to contact per day across all email accounts
string
When to stop emailing a lead:
REPLY_TO_AN_EMAIL, OPENED_EMAIL, CLICKED_LINK, or NEVERstring
Scheduled start time for campaign (ISO 8601 format),
null if starting immediatelyboolean
When
true, SmartLead’s AI automatically matches leads with optimal email accounts based on provider and deliverability historyboolean
When
true, emails are sent as plain text instead of HTML for better deliverability with technical audiencesnumber
Percentage of leads that receive follow-up emails (0-100)
string
Custom unsubscribe footer text
number
If this is a subsequence, references the parent campaign ID.
null for main campaigns.number
Associated client ID for agency/white-label accounts.
null for direct user campaigns.curl -X GET "https://server.smartlead.ai/api/v1/campaigns/?api_key=YOUR_API_KEY&include_tags=true"
import requests
API_KEY = "YOUR_API_KEY"
url = "https://server.smartlead.ai/api/v1/campaigns/"
response = requests.get(
url,
params={
"api_key": API_KEY,
"include_tags": True
}
)
campaigns = response.json()
print(f"Total campaigns: {len(campaigns['campaigns'])}")
const API_KEY = 'YOUR_API_KEY';
async function getAllCampaigns() {
const response = await fetch(
`https://server.smartlead.ai/api/v1/campaigns/?api_key=${API_KEY}&include_tags=true`
);
const data = await response.json();
return data.campaigns;
}
getAllCampaigns().then(campaigns => {
console.log(`Found ${campaigns.length} campaigns`);
});
<?php
$api_key = 'YOUR_API_KEY';
$url = 'https://server.smartlead.ai/api/v1/campaigns/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "$url?api_key=$api_key&include_tags=true");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
echo "Total campaigns: " . count($data['campaigns']);
?>
[
{
"id": 2710262,
"user_id": 196026,
"created_at": "2025-11-25T10:43:46.826Z",
"updated_at": "2025-11-25T14:02:21.776Z",
"status": "ACTIVE",
"name": "Cold Outreach Q1 2024",
"track_settings": ["DONT_EMAIL_OPEN", "DONT_LINK_CLICK"],
"scheduler_cron_value": {
"tz": "America/New_York",
"days": [1, 2, 3, 4, 5],
"endHour": "19:00",
"startHour": "09:00"
},
"min_time_btwn_emails": 24,
"max_leads_per_day": 100,
"stop_lead_settings": "REPLY_TO_AN_EMAIL",
"schedule_start_time": null,
"enable_ai_esp_matching": true,
"send_as_plain_text": false,
"follow_up_percentage": 20,
"unsubscribe_text": "",
"parent_campaign_id": null,
"client_id": null,
"tags": [
{
"tag_id": 1,
"tag_name": "Q1",
"tag_color": "#FF5733"
}
]
}
]
Response Format: This endpoint returns a direct array of campaigns, not wrapped in a success object. Each campaign contains comprehensive configuration including schedule, tracking settings, AI preferences, and sending limits.
{
"message": "Invalid API Key"
}
{
"error": "Resource not found"
}
{
"error": "Invalid parameters provided"
}
Response Codes
Success
Campaigns retrieved successfully
Unauthorized
Invalid or missing API key
Internal Server Error
Server error occurred
Filtering Campaigns
You can filter campaigns by:- Client ID: Get campaigns for a specific client
- Status: Use the campaign status filter in your application logic after fetching
- Tags: Include tags to filter on your end
Pagination
Currently, this endpoint returns all campaigns. For large accounts with many campaigns, consider implementing pagination on your end or contact support for enterprise pagination options.Cache campaign lists to reduce API calls. Only fetch when you need fresh data.
Common Use Cases
Get Active Campaigns Only
Python
import requests
API_KEY = "YOUR_API_KEY"
url = "https://server.smartlead.ai/api/v1/campaigns/"
response = requests.get(url, params={"api_key": API_KEY})
campaigns = response.json()
active_campaigns = [
c for c in campaigns['campaigns']
if c['status'] == 'ACTIVE'
]
print(f"Active campaigns: {len(active_campaigns)}")
Get Campaigns by Client
Python
client_id = 456
response = requests.get(
url,
params={
"api_key": API_KEY,
"client_id": client_id
}
)
campaigns = response.json()
