Skip to content

Delete campaign

Deletes one or more campaigns.

HTTP method: DELETE

https://api.sender.net/v2/campaigns?ids=[eE0x14]


ParameterTypeDescription
idsarray requiredYou can provide an array of multiple campaign IDs to be deleted. Specifying the string “all” will delete all campaigns in your account.
statusstringStatus should be among - ‘DRAFT’, ‘SENT’, ‘PENDING’, ‘PREPARING’
titlestringProvide the Campaign’s title

const url = new URL("https://api.sender.net/v2/campaigns?ids=[eE0x14]");
let headers = {
"Authorization": "Bearer [your-token]",
"Content-Type": "application/json",
"Accept": "application/json",
};
let bodyContent = {
"status": "DRAFT",
"title": "Campaign's title"
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(bodyContent)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Example Response
{
"success": true,
"message": "Deleted"
}