API Reference

Delete campaign

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

DELETE/campaigns/:id

Permanently deletes a campaign. This cannot be undone. You can delete campaigns in draft, scheduled, recurring, sent, failed, or canceled status. Pending sends and follow-ups are canceled. Sent emails and delivery events remain in Emails; the campaign and its statistics page are removed.

Path parameters
idstringrequired

The campaign ID.

import { SendDart } from 'senddart';

const mb = new SendDart('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) if the campaign is queued or paused, or a background job is still running. Stop the campaign or its follow-ups and wait for running work to finish before retrying.