curl -X DELETE "https://server.smartlead.ai/api/v1/campaigns/123?api_key=YOUR_API_KEY"
import requests
API_KEY = "YOUR_API_KEY"
campaign_id = 123
# Confirm before deleting
confirm = input(f"Delete campaign {campaign_id}? (yes/no): ")
if confirm.lower() == 'yes':
response = requests.delete(
f"https://server.smartlead.ai/api/v1/campaigns/{campaign_id}",
params={"api_key": API_KEY}
)
if response.status_code == 200:
print("Campaign deleted successfully")
else:
print(f"Error: {response.text}")
const API_KEY = 'YOUR_API_KEY';
const campaignId = 123;
// Confirm before deleting
const confirmed = confirm(`Delete campaign ${campaignId}? This cannot be undone!`);
if (confirmed) {
const response = await fetch(
`https://server.smartlead.ai/api/v1/campaigns/${campaignId}?api_key=${API_KEY}`,
{ method: 'DELETE' }
);
console.log('Campaign deleted');
}
{
"success": true,
"message": "Campaign deleted successfully"
}
{
"success": false,
"error": {
"code": "CAMPAIGN_ACTIVE",
"message": "Cannot delete active campaign. Please stop it first."
}
}
{
"message": "Invalid API Key"
}
{
"error": "Resource not found"
}
{
"error": "Invalid parameters provided"
}
Campaign Management
Delete Campaign
Permanently and irreversibly deletes a campaign and ALL associated data: sequences, lead-campaign mappings, email statis
DELETE
/
api
/
v1
/
campaigns
/
{campaign_id}
curl -X DELETE "https://server.smartlead.ai/api/v1/campaigns/123?api_key=YOUR_API_KEY"
import requests
API_KEY = "YOUR_API_KEY"
campaign_id = 123
# Confirm before deleting
confirm = input(f"Delete campaign {campaign_id}? (yes/no): ")
if confirm.lower() == 'yes':
response = requests.delete(
f"https://server.smartlead.ai/api/v1/campaigns/{campaign_id}",
params={"api_key": API_KEY}
)
if response.status_code == 200:
print("Campaign deleted successfully")
else:
print(f"Error: {response.text}")
const API_KEY = 'YOUR_API_KEY';
const campaignId = 123;
// Confirm before deleting
const confirmed = confirm(`Delete campaign ${campaignId}? This cannot be undone!`);
if (confirmed) {
const response = await fetch(
`https://server.smartlead.ai/api/v1/campaigns/${campaignId}?api_key=${API_KEY}`,
{ method: 'DELETE' }
);
console.log('Campaign deleted');
}
{
"success": true,
"message": "Campaign deleted successfully"
}
{
"success": false,
"error": {
"code": "CAMPAIGN_ACTIVE",
"message": "Cannot delete active campaign. Please stop it first."
}
}
{
"message": "Invalid API Key"
}
{
"error": "Resource not found"
}
{
"error": "Invalid parameters provided"
}
Strongly recommended: Export all important data first and consider using ARCHIVED status instead to preserve data while hiding from active views.
Permanently and irreversibly deletes a campaign and ALL associated data: sequences, lead-campaign mappings, email statistics, webhook configurations, scheduled emails, and conversation history
Path Parameters
number
required
The ID of the campaign to delete
Query Parameters
string
required
Your SmartLead API key
This action is permanent and cannot be undone!Deleting a campaign will remove:
- All campaign sequences
- All lead associations
- All statistics and analytics data
- All webhook configurations
- All email threads and history
curl -X DELETE "https://server.smartlead.ai/api/v1/campaigns/123?api_key=YOUR_API_KEY"
import requests
API_KEY = "YOUR_API_KEY"
campaign_id = 123
# Confirm before deleting
confirm = input(f"Delete campaign {campaign_id}? (yes/no): ")
if confirm.lower() == 'yes':
response = requests.delete(
f"https://server.smartlead.ai/api/v1/campaigns/{campaign_id}",
params={"api_key": API_KEY}
)
if response.status_code == 200:
print("Campaign deleted successfully")
else:
print(f"Error: {response.text}")
const API_KEY = 'YOUR_API_KEY';
const campaignId = 123;
// Confirm before deleting
const confirmed = confirm(`Delete campaign ${campaignId}? This cannot be undone!`);
if (confirmed) {
const response = await fetch(
`https://server.smartlead.ai/api/v1/campaigns/${campaignId}?api_key=${API_KEY}`,
{ method: 'DELETE' }
);
console.log('Campaign deleted');
}
Response Codes
Success
Request successful
Bad Request
Invalid request parameters or malformed request body
Unauthorized
Invalid or missing API key. Check your authentication.
Not Found
The requested resource (campaign, lead, email account, etc.) does not exist or you don’t have access to it
Validation Error
Request validation failed. Check parameter types, required fields, and value constraints.
Rate Limit Exceeded
Too many requests. Please slow down and retry after the rate limit resets.
Internal Server Error
Server error occurred. Please try again or contact support if the issue persists.
Service Unavailable
API is temporarily unavailable or under maintenance. Please try again later.
{
"success": true,
"message": "Campaign deleted successfully"
}
{
"success": false,
"error": {
"code": "CAMPAIGN_ACTIVE",
"message": "Cannot delete active campaign. Please stop it first."
}
}
{
"message": "Invalid API Key"
}
{
"error": "Resource not found"
}
{
"error": "Invalid parameters provided"
}
Before Deleting
Export Your Data
Export Your Data
Export leads, statistics, and any important data before deleting
# Export leads first
curl "https://server.smartlead.ai/api/v1/campaigns/123/leads-export?api_key=YOUR_KEY"
Stop the Campaign
Stop the Campaign
Some systems require campaigns to be stopped before deletion
# Stop first
curl -X PATCH "https://server.smartlead.ai/api/v1/campaigns/123/status?api_key=YOUR_KEY" \
-d '{"status": "STOPPED"}'
# Then delete
curl -X DELETE "https://server.smartlead.ai/api/v1/campaigns/123?api_key=YOUR_KEY"
Consider Archiving Instead
Consider Archiving Instead
If you might need the data later, use ARCHIVED status instead
curl -X PATCH "https://server.smartlead.ai/api/v1/campaigns/123/status?api_key=YOUR_KEY" \
-d '{"status": "ARCHIVED"}'
Alternative: Archive Campaign
Instead of deleting, you can archive:curl -X PATCH "https://server.smartlead.ai/api/v1/campaigns/123/status?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"status": "ARCHIVED"}'
- ✅ Keeps all data
- ✅ Reversible
- ✅ Can analyze later
- ✅ Hides from active list
