flag_thread
Apply flag changes to every message in a conversation thread by specifying one message's ID. Resolves the full reply chain, optionally across folders.
Instructions
Add or remove flags on every message in a thread, identified by Message-ID. Use this instead of update_message_flags when you want the change applied to a whole conversation, or bulk_update_flags when you have a flat set of UIDs rather than a thread. At least one of flagsToAdd/flagsToRemove must be non-empty. acrossFolders:false by default. dryRun:true previews.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| messageId | Yes | RFC 5322 Message-ID of any message in the thread (e.g. `<abc@example.com>`); the whole reply chain is resolved from it. | |
| flagsToAdd | No | Flags to add to every message in the thread. System flags include the backslash (e.g. ["\\Seen", "\\Flagged"]); user keywords are bare alphanumerics (e.g. ["Important"]). At least one of flagsToAdd/flagsToRemove must be non-empty. | |
| flagsToRemove | No | Flags to remove from every message in the thread (e.g. ["\\Seen"] to mark the whole thread unread, or ["\\Flagged"] to unstar). | |
| acrossFolders | No | When false (default), act only within the seed message's folder. When true, walk INBOX + Sent + All Mail so the flag change covers thread members in other folders. | |
| dryRun | No | When true, preview which messages would be updated (per folder) without changing any flags. |