mail_mark_messages
Mark specific iCloud Mail messages as read, unread, flagged, or unflagged by UID while leaving them in their folder and changing nothing else.
Instructions
Set or clear the read and flagged state of specific messages, by uid, without moving them or changing anything else.
Use when: the owner asks to mark particular messages read, unread, flagged or unflagged. Not for everything matching a filter (use mail_run_bulk_action with action mark_read, which previews and can be undone), for filing (use mail_move_messages), or for deleting (use mail_delete_messages). Parameters:
uids and uidvalidity must come from the same mail_search_messages (or mail_get_messages) result for folder.
read and flagged are independent: omit one to leave it as it is; omitting both changes nothing.
read=false marks unread, flagged=false removes the flag. Behavior:
Only the Seen and Flagged flags change; the messages stay in their folder and the change syncs to the owner's devices.
Repeating the call gives the same state.
A renumbered folder (uidvalidity changed) is refused before anything changes.
A long list goes in chunks. Returns: {folder, uids, read, flagged}, echoing what was applied; it does not confirm that each uid still exists. Errors: 'Could not open the folder' (check mail_list_folders) or out-of-date uids (search again).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| read | No | true = mark read, false = mark unread, omit = leave unchanged. | |
| uids | Yes | Message uids in that folder (from mail_search_messages). | |
| folder | Yes | Mail folder, e.g. INBOX, Sent, Archive or a custom name. | |
| flagged | No | true = flag, false = unflag, omit = leave unchanged. | |
| uidvalidity | Yes | The 'uidvalidity' from the result the uids came from (required: a renumbered folder is refused, not misread). |