curl -X DELETE "https://api.usegately.com/api/v1/campaigns/CAMPAIGN_ID" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID"
import { GatelyCampaigns } from '@gately/sdk'
const campaigns = new GatelyCampaigns({ projectId: 'YOUR_PROJECT_ID' })
await campaigns.delete('CAMPAIGN_ID')
{
"success": true,
"message": "Campaign deleted successfully",
"campaignId": "a1b2c3d4-e5f6-4789-abcd-ef1234567890"
}
{
"error": "Cannot delete campaign that is currently sending"
}
{
"error": "Campaign not found"
}
Email Campaigns
Delete Campaign
Permanently delete a campaign
DELETE
/
api
/
v1
/
campaigns
/
{campaignId}
curl -X DELETE "https://api.usegately.com/api/v1/campaigns/CAMPAIGN_ID" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID"
import { GatelyCampaigns } from '@gately/sdk'
const campaigns = new GatelyCampaigns({ projectId: 'YOUR_PROJECT_ID' })
await campaigns.delete('CAMPAIGN_ID')
{
"success": true,
"message": "Campaign deleted successfully",
"campaignId": "a1b2c3d4-e5f6-4789-abcd-ef1234567890"
}
{
"error": "Cannot delete campaign that is currently sending"
}
{
"error": "Campaign not found"
}
Campaigns with status
sending cannot be deleted. All other statuses (scheduled, sent, partially_sent, failed) can be deleted.Headers
string
required
Bearer YOUR_API_KEYstring
Your project UUID. Not required if the API key already encodes the project.
Path Parameters
string
required
Campaign UUID to delete
Response
boolean
true on successful deletionstring
Human-readable confirmation
string
ID of the deleted campaign
curl -X DELETE "https://api.usegately.com/api/v1/campaigns/CAMPAIGN_ID" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID"
import { GatelyCampaigns } from '@gately/sdk'
const campaigns = new GatelyCampaigns({ projectId: 'YOUR_PROJECT_ID' })
await campaigns.delete('CAMPAIGN_ID')
{
"success": true,
"message": "Campaign deleted successfully",
"campaignId": "a1b2c3d4-e5f6-4789-abcd-ef1234567890"
}
{
"error": "Cannot delete campaign that is currently sending"
}
{
"error": "Campaign not found"
}
Was this page helpful?