Skip to main content

Cancel Campaign

Cancel a campaign that is scheduled, queued, or actively sending.

Endpoint​

POST /push/campaigns/:id/cancel

Returns: 200 OK

Path Parameters​

ParameterTypeDescription
idstringCampaign ID

Headers​

HeaderValueRequired
AuthorizationBearer <your-api-key>Yes
Idempotency-KeyAny unique string, max 256 charsNo. Makes a retry safe; see Idempotency

Which campaigns can be cancelled​

StatusCancellable
scheduledYes
queuedYes
sendingYes, remaining batches stop
draftNo. Delete it instead
sent, failed, cancelledNo, already terminal
Cancelling mid-send does not recall what already went

Cancelling a sending campaign stops the batches that have not started yet. Notifications already handed to FCM or the browser's push service cannot be recalled and will still arrive.


Response​

The cancelled campaign, with status: "cancelled".


Examples​

curl -X POST "https://api.arsel.sa/v1/push/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456/cancel" \
-H "Authorization: Bearer $ARSEL_API_KEY"

Error Responses​

{
"status_code": 400,
"name": "bad_request",
"message": "Cannot cancel a campaign with status \"Sent\""
}