API Reference

Delete campaign

DELETE /campaigns/:id — permanently delete a campaign.

DELETE/campaigns/:id

Permanently deletes a campaign. This cannot be undone. You can only delete campaigns in the draft, scheduled, or recurring status; deleting a scheduled or recurring campaign also cancels its pending job so it will not fire.

Path parameters
idstringrequired

The campaign ID.

import { Mailblastr } from 'mailblastr';

const mb = new Mailblastr('mb_xxxxxxxxx');

const { data, error } = await mb.campaigns.remove('8f5c2a1e-7b3d-4f9a-9c12-2e6d4a7b8c90');
console.log({ data, error });

Response

{
  "object": "campaign",
  "id": "8f5c2a1e-7b3d-4f9a-9c12-2e6d4a7b8c90",
  "deleted": true
}
Errors: not_found if the campaign does not exist or is not yours; validation_error (422) for a campaign in any other status — a campaign that is already queued, sent, failed or canceled cannot be deleted.