Get an API key
Mailbox

messages.remove()

mailbox.messages.remove(id) → Promise<{ ok: true }>

Moves the message to trash — and from trash, deletes it for good.

DELETEtrash firstfinal from trash
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

await box.messages.remove(id);   // to trash
await box.messages.remove(id);   // from trash: gone
box.messages.remove(message_id)   # to trash
box.messages.remove(message_id)   # from trash: gone

The same call, twice

Elsewhere, « delete » means « go to trash »

Only in trash does it mean gone. Somebody who clicks the wrong button must be able to come back — and the one place that cannot be true is the folder whose meaning is already « on the way out ».

Getting it back

await box.messages.update(id, { folder: "inbox" });
box.messages.update(message_id, {"folder": "inbox"})

Attachments go with it

Permanent deletion releases the attachment bytes too, and the account's object storage gets the space back.

Emptying the trash

let page = await box.messages.list({ folder: "trash", limit: 100 });
for (const message of page.messages) await box.messages.remove(message.id);
page = box.messages.list(folder="trash", limit=100)
for message in page["messages"]:
    box.messages.remove(message["id"])

There is no bulk call: deleting a hundred messages is a hundred deliberate deletions.