Skip to content

MailerCancelEmail

POST mailer/email/cancel

Cancels an email while it is still in the queue. A message already handed to the provider cannot be recalled — the answer says so instead of pretending it was stopped.

Use it for a scheduled email or one waiting for a send window.

Access Control

Allowed roles: admin, leader, manager.

Request

POST https://{broker_domain}/mailer/email/cancel
{
  "emailId": 814,
  "reason": "Campaign stopped by the client"
}
{
  "command": "MailerCancelEmail",
  "extID": "1",
  "data": {
    "emailId": 814,
    "reason": "Campaign stopped by the client"
  }
}
const res = await platform.MailerCancelEmail({
  emailId: 814,
  reason: "Campaign stopped by the client"
});

Request Data

Field Type Required Description
emailId int Yes Email to cancel
reason string No Why it was cancelled, up to 512 characters; stored with the email

Response Data

The cancelled email ends up in a final status with closedBy: "CRM", so reports can tell an operator cancellation from a provider failure.

{
  "emailId": 814,
  "status": "REJECTED"
}

Errors

Code Error Description
404 EMAIL_NOT_FOUND Email not found in the brand
409 EMAIL_NOT_CANCELLABLE The email has left the queue and cannot be cancelled