await box.messages.remove(id); // to trash
await box.messages.remove(id); // from trash: gonebox.messages.remove(message_id) # to trash
box.messages.remove(message_id) # from trash: goneThe 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.