# messages.update()

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

`mailbox.messages.update(id, { read?, starred?, folder? }) → Promise<Message>`

Marks a message read or starred, or moves it to another folder.

Status: PATCH · 3 fields · folder moves it

```javascript
await box.messages.update(id, { read: true });
await box.messages.update(id, { starred: true });
await box.messages.update(id, { folder: "trash" });
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `read` | boolean |  | Read or unread. |
| `starred` | boolean |  | Starred or not. |
| `folder` | string |  | `inbox` · `sent` · `drafts` · `spam` · `trash`. Moves it. |

## Moving is a folder change {#moving}

Archiving, trashing and marking as spam are all this call with a different folder — one operation rather than three, and every one of them reversible by setting the folder back.

## Against remove() {#versus-remove}

|  | update({ folder: "trash" }) | remove() |
| --- | --- | --- |
| From a normal folder | moves to trash | moves to trash |
| From trash | — | **deletes permanently** |

> **Deleting from anywhere but trash means « go there »**
>
> Somebody who clicks the wrong button should be able to come back. The only place delete is final is the place whose whole meaning is « on the way out ».

## unreadCount follows {#counts}

Marking read changes the folder's count in the next listing. There is no separate call for a badge.

- [messages.remove()](/sdk/ref/mailbox/messages/remove): Deleting.
- [messages.list()](/sdk/ref/mailbox/messages/list): The counts.

```python
box.messages.update(message_id, {"read": True})
box.messages.update(message_id, {"starred": True})
box.messages.update(message_id, {"folder": "trash"})
```
