API Reference

Cancel campaign

POST /campaigns/:id/cancel — return a scheduled campaign to draft, or terminally stop one that is already sending.

POST/campaigns/:id/cancel

Cancels a campaign that still has pending work. A scheduled, recurring or reputation-paused campaign has its pending job dropped and returns to the draft status, so you can edit it and send or schedule it again. A campaign that is already sending (reported as queued) is stopped instead: all remaining work is cancelled and it becomes the terminal status canceled, which cannot be resumed or re-sent. Returns the updated campaign object.

Path parameters
idstringrequired

The campaign ID.

import { Mailblastr } from 'mailblastr';

const mb = new Mailblastr('mb_xxxxxxxxx');

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

Response

{
  "object": "campaign",
  "id": "8f5c2a1e-7b3d-4f9a-9c12-2e6d4a7b8c90",
  "name": "June newsletter",
  "audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
  "segment_id": null,
  "topic_id": null,
  "from": "Acme <news@yourdomain.com>",
  "subject": "What's new in June",
  "html": "<p>Hi {{FIRST_NAME}}!</p>",
  "text": "Hi {{FIRST_NAME}}!",
  "reply_to": null,
  "preview_text": null,
  "status": "draft",
  "scheduled_at": null,
  "sent_at": null,
  "created_at": "2026-06-23T10:00:00.000Z",
  "ab_test": { "enabled": false },
  "recurrence": null,
  "parent_campaign_id": null
}
Errors: not_found if the campaign does not exist or is not yours; validation_error if it is not in one of the four cancelable states (scheduled, recurring, paused, or queued).