API Reference

Delete Received Email

DELETE /emails/receiving/:id — permanently delete a received email and its stored objects.

DELETE/emails/receiving/:id

Permanently deletes a received email and all of its associated storage objects — the raw .eml file and every attachment stored for that email. This action cannot be undone. Requires a write-scoped API key.

Path parameters
idstringrequired

The id of the received email to delete.

import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.emails.receiving.remove('4ef9a417-02e9-4d39-ad75-9611e0fcc33c');
console.log({ data, error });

Response

{
  "object": "received_email",
  "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
  "deleted": true
}

Returns not_found (404) if the received email does not exist for your account. See the error reference.