API Reference
Cancel an email
POST /emails/:id/cancel — cancel a scheduled email.
POST
/emails/:id/cancelCancel a still-scheduled email so it is never sent. The email moves to the canceled status and its pending delivery job is removed. Only emails in the scheduled state can be canceled. See Schedule email.
Path parameters
idstringrequiredThe id of the scheduled email to cancel.
Request
import { MailBlastr } from 'mailblastr';
const mb = new MailBlastr('mb_xxxxxxxxx');
const { data, error } = await mb.emails.cancel('49a3999c-0ce1-4ea6-ab68-afcd6dc2e794');
console.log({ data, error });Response
{
"object": "email",
"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
}Errors
Returns not_found (404) if the email does not exist for your account; validation_error if the email is not in the scheduled state (i.e. it has already been sent or canceled). See the error reference.