Delete Campaign
Delete a push campaign.
Endpoint
DELETE /push/campaigns/{id}
Returns: 200 OK
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Campaign ID |
Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer <your-api-key> | Yes |
Delete does not stop a send in progress
Deleting a campaign that is Queued or Sending does not halt fan-out. Use Cancel Campaign to stop delivery, then delete if you also want it out of your list.
The campaign is soft-deleted: it disappears from List Campaigns, while the analytics already recorded against it are preserved.
Response
{
"message": "Campaign deleted"
}
Examples
- cURL
- JavaScript
- Python
- C#
- PHP
curl -X DELETE "https://api.arsel.sa/v1/push/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456" \
-H "Authorization: Bearer be_your_api_key"
const id = "0192a1b2-c3d4-7e5f-9000-abcdef123456";
const response = await fetch(`https://api.arsel.sa/v1/push/campaigns/${id}`, {
method: "DELETE",
headers: { Authorization: "Bearer be_your_api_key" },
});
console.log(await response.json());
import requests
campaign_id = "0192a1b2-c3d4-7e5f-9000-abcdef123456"
response = requests.delete(
f"https://api.arsel.sa/v1/push/campaigns/{campaign_id}",
headers={"Authorization": "Bearer be_your_api_key"},
)
print(response.json()["message"])
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer be_your_api_key");
var id = "0192a1b2-c3d4-7e5f-9000-abcdef123456";
var response = await client.DeleteAsync(
$"https://api.arsel.sa/v1/push/campaigns/{id}");
Console.WriteLine(await response.Content.ReadAsStringAsync());
<?php
$id = "0192a1b2-c3d4-7e5f-9000-abcdef123456";
$ch = curl_init("https://api.arsel.sa/v1/push/campaigns/$id");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer be_your_api_key"]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
echo curl_exec($ch);
curl_close($ch);
Error Responses
- 404 Not Found
- 401 Unauthorized
{
"status_code": 404,
"name": "not_found",
"message": "Campaign not found"
}
{
"status_code": 401,
"name": "unauthorized",
"message": "Invalid or missing API key"
}