# messages.remove()

Canonical URL: https://developers.iagenify.com/sdk/ref/mailbox/messages/remove/
Language: en

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

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

Status: DELETE · trash first · final from trash

```javascript
await box.messages.remove(id);   // to trash
await box.messages.remove(id);   // from trash: gone
```

## The same call, twice {#two-meanings}

> **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 {#recovering}

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

## Attachments go with it {#attachments}

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

## Emptying the trash {#emptying}

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

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

- [messages.update()](/sdk/ref/mailbox/messages/update): Moving instead.
- [messages.list()](/sdk/ref/mailbox/messages/list): Walking a folder.

```python
box.messages.remove(message_id)   # to trash
box.messages.remove(message_id)   # from trash: gone
```

```python
box.messages.update(message_id, {"folder": "inbox"})
```

```python
page = box.messages.list(folder="trash", limit=100)
for message in page["messages"]:
    box.messages.remove(message["id"])
```
