Get an API key
Mailbox

messages.update()

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

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

PATCH3 fieldsfolder moves it
Using Python?

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

await box.messages.update(id, { read: true });
await box.messages.update(id, { starred: true });
await box.messages.update(id, { folder: "trash" });
box.messages.update(message_id, {"read": True})
box.messages.update(message_id, {"starred": True})
box.messages.update(message_id, {"folder": "trash"})
readboolean

Read or unread.

starredboolean

Starred or not.

folderstring

inbox · sent · drafts · spam · trash. Moves it.

Moving is a folder change

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()

update({ folder: "trash" })remove()
From a normal foldermoves to trashmoves 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

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