curl -X DELETE "https://server.smartlead.ai/api/v1/campaigns/tags?api_key=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"campaignIds": [101, 204],
"tagIds": [6, 9]
}'
import requests
API_KEY = "YOUR_API_KEY"
response = requests.delete(
"https://server.smartlead.ai/api/v1/campaigns/tags",
params={"api_key": API_KEY},
json={
"campaignIds": [101, 204],
"tagIds": [6, 9]
}
)
result = response.json()
print(f"Removed {result['removed']} of {result['requested']} tag-campaign pairs")
const API_KEY = 'YOUR_API_KEY';
const response = await fetch(
`https://server.smartlead.ai/api/v1/campaigns/tags?api_key=${API_KEY}`,
{
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
campaignIds: [101, 204],
tagIds: [6, 9]
})
}
);
const result = await response.json();
console.log(`Removed ${result.removed} of ${result.requested} tag-campaign pairs`);
{
"ok": true,
"message": "Tags removed from campaigns successfully!",
"campaign_ids": [101, 204],
"tag_ids": [6, 9],
"requested": 4,
"removed": 3,
"not_present": 1
}
{
"ok": false,
"error": "Campaigns not found - one or more campaignIds are invalid.",
"not_found_campaign_ids": [204]
}
{
"ok": false,
"error": "Tags not found - one or more tagIds are invalid.",
"not_found_tag_ids": [9]
}
{
"message": "Invalid API Key"
}
Campaign Management
Remove Tags from Campaigns
Detach one or more tags from one or more campaigns in a single request
DELETE
/
api
/
v1
/
campaigns
/
tags
curl -X DELETE "https://server.smartlead.ai/api/v1/campaigns/tags?api_key=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"campaignIds": [101, 204],
"tagIds": [6, 9]
}'
import requests
API_KEY = "YOUR_API_KEY"
response = requests.delete(
"https://server.smartlead.ai/api/v1/campaigns/tags",
params={"api_key": API_KEY},
json={
"campaignIds": [101, 204],
"tagIds": [6, 9]
}
)
result = response.json()
print(f"Removed {result['removed']} of {result['requested']} tag-campaign pairs")
const API_KEY = 'YOUR_API_KEY';
const response = await fetch(
`https://server.smartlead.ai/api/v1/campaigns/tags?api_key=${API_KEY}`,
{
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
campaignIds: [101, 204],
tagIds: [6, 9]
})
}
);
const result = await response.json();
console.log(`Removed ${result.removed} of ${result.requested} tag-campaign pairs`);
{
"ok": true,
"message": "Tags removed from campaigns successfully!",
"campaign_ids": [101, 204],
"tag_ids": [6, 9],
"requested": 4,
"removed": 3,
"not_present": 1
}
{
"ok": false,
"error": "Campaigns not found - one or more campaignIds are invalid.",
"not_found_campaign_ids": [204]
}
{
"ok": false,
"error": "Tags not found - one or more tagIds are invalid.",
"not_found_tag_ids": [9]
}
{
"message": "Invalid API Key"
}
Detaches every tag in
tagIds from every campaign in campaignIds (the full cartesian product). The operation is idempotent — pairs that aren’t currently tagged are simply skipped rather than causing an error.Query Parameters
string
required
Your SmartLead API key
Request Body
number[]
required
Campaign IDs to untag. 1–100 positive integers.
number[]
required
Tag IDs to detach. 1–100 positive integers.
All campaigns and tags must belong to the authenticated account (or the client scoped to the API key). Validation is all-or-nothing — if any
campaignIds or tagIds value doesn’t belong to the caller, the entire request is rejected and nothing is applied.curl -X DELETE "https://server.smartlead.ai/api/v1/campaigns/tags?api_key=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"campaignIds": [101, 204],
"tagIds": [6, 9]
}'
import requests
API_KEY = "YOUR_API_KEY"
response = requests.delete(
"https://server.smartlead.ai/api/v1/campaigns/tags",
params={"api_key": API_KEY},
json={
"campaignIds": [101, 204],
"tagIds": [6, 9]
}
)
result = response.json()
print(f"Removed {result['removed']} of {result['requested']} tag-campaign pairs")
const API_KEY = 'YOUR_API_KEY';
const response = await fetch(
`https://server.smartlead.ai/api/v1/campaigns/tags?api_key=${API_KEY}`,
{
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
campaignIds: [101, 204],
tagIds: [6, 9]
})
}
);
const result = await response.json();
console.log(`Removed ${result.removed} of ${result.requested} tag-campaign pairs`);
Response Fields
boolean
true on successstring
"Tags removed from campaigns successfully!"number[]
Deduplicated list of campaign IDs the request was applied to
number[]
Deduplicated list of tag IDs the request was applied to
number
Total number of campaign/tag pairs requested (
campaign_ids.length × tag_ids.length)number
Number of pairs actually removed
number
Number of pairs that weren’t tagged in the first place and were skipped
Response Codes
Success
Tags processed successfully (see
removed / not_present for the outcome)Bad Request
Invalid request parameters or malformed request body
Unauthorized
Invalid or missing API key
Not Found
One or more
campaignIds or tagIds don’t exist or don’t belong to the authenticated accountValidation Error
Request validation failed. Check parameter types and constraints (array length 1–100, positive integers).
Internal Server Error
Server error occurred
{
"ok": true,
"message": "Tags removed from campaigns successfully!",
"campaign_ids": [101, 204],
"tag_ids": [6, 9],
"requested": 4,
"removed": 3,
"not_present": 1
}
{
"ok": false,
"error": "Campaigns not found - one or more campaignIds are invalid.",
"not_found_campaign_ids": [204]
}
{
"ok": false,
"error": "Tags not found - one or more tagIds are invalid.",
"not_found_tag_ids": [9]
}
{
"message": "Invalid API Key"
}
