Delete campaign
post
https://app.iteras.dk/api/campaigns/deletecampaign/
The /api/campaigns/deletecampaign/ endpoint deletes a
campaign.
A campaign can only be deleted if no subscriptions have ever been on it. Otherwise the campaign is left alone and an error is returned, since deleting it would remove subscription history.
Parameters
-
id string requiredThe Iteras ID of the campaign to delete. It is returned as
idby the campaign retrieval API and bycreatecampaign.
Examples
POST /api/campaigns/deletecampaign/ HTTP/1.1
Content-Type: application/json{
"id": "308"
}Return value
On success the endpoint returns the Iteras ID and the campaign ID of the deleted campaign:
{ "deleted": true, "id": "308", "campaign_id": "3i" }
Errors
Invalid JSON returns 400, and an unknown id returns 404.
If the campaign has subscriptions, nothing is deleted and 422 is returned:
{ "deleted": false, "errors": { "id": ["Subscriptions refer to the campaign. It cannot be deleted."] } }