DELETE
/api/public/v1/campaigns/{campaignId}Delete a campaign
Only one that never sent. The per-person outcomes of a send are the record of what the company said to its customers, and that is not something to be able to erase.
Required scope
The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Settings → Company → API, and to a teammate under Employee → Permissions.
campaigns:write
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
campaignId | string | Required | Campaign ID. |
DELETEExample request
curl
curl -X DELETE "https://www.pxb.app/api/public/v1/campaigns/{campaignId}" \
-H "Authorization: Bearer your_access_token"200Example response
json
{
"message": "Campaign deleted successfully!",
"content": {
"campaignId": "cmp_3311"
}
}400Example response
json
{
"message": "A campaign that has sent cannot be deleted."
}In the console
The same thing done by hand, for anyone comparing the API against the screen they already use.