bulk_update_flags
Apply the same IMAP flag change, such as read or starred, to many emails at once by selecting email IDs or using search criteria in a folder. Get per-message results for flags that were not applied.
Instructions
Add or remove IMAP flags on multiple messages simultaneously. Use when the same flag change (e.g. \Seen, \Flagged) should apply to several messages. Accepts emailIds[] OR match+folder (XOR). Returns notApplied[] per message for flags the server silently dropped. Prefer update_message_flags for a single message when you need per-flag server verification.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| match | No | Search criteria. XOR with emailIds. | |
| dryRun | No | ||
| folder | No | Source folder (required with match). | |
| emailIds | No | Explicit email IDs. XOR with match. | |
| flagsToAdd | No | IMAP flags to set, e.g. ["\\Seen", "\\Flagged"]. | |
| maxBatchSize | No | Maximum number of messages to process. Defaults to 500. Use to prevent runaway operations. | |
| flagsToRemove | No | IMAP flags to clear. |