API Reference

Cancel campaign

POST /campaigns/:id/cancel — cancel a scheduled campaign and return it to draft.

POST/campaigns/:id/cancel

Cancels a scheduled campaign: the pending delivery is dropped and the campaign returns to the draft status, so you can edit it and send or schedule it again. Only a scheduled campaign can be canceled. 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": "aud_3b1c...",
  "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 the scheduled status.