update_rule
Update an existing Outlook inbox rule by patching its fields, conditions, or actions. Specify changes to replace condition/action blocks, or omit them to keep current settings.
Instructions
Patch fields of an existing inbox mail rule. Pass None to leave a field unchanged.
Replacement semantics for nested blocks:
Graph PATCH on messageRules replaces the entire conditions or
actions block when you send it. If you pass ANY condition arg
(sender_contains, subject_contains, body_contains,
body_or_subject_contains, from_addresses, has_attachments) the
rule's conditions are rebuilt from ONLY the args you pass — any
existing conditions you don't re-specify are dropped. Same for
actions (move_to_folder, mark_as_read, delete,
stop_processing_rules). If you don't pass any condition or
action args, the existing blocks are preserved.
If you want to add to a block without losing the rest, call
``get_rule`` first and re-supply the existing values.Args: rule_id: Graph rule id. Required. display_name: New display name. None = unchanged. is_enabled: Enable/disable the rule. None = unchanged. sequence: New order (lower runs first). None = unchanged. sender_contains / subject_contains / body_contains / body_or_subject_contains / from_addresses / has_attachments: Passing any of these REPLACES the conditions block. move_to_folder / mark_as_read / delete / stop_processing_rules: Passing any of these REPLACES the actions block. mailbox: Optional mailbox for shared mailboxes. include_raw: Include the raw Graph payload.
Returns: The trimmed updated rule.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| delete | No | ||
| mailbox | No | ||
| rule_id | Yes | ||
| sequence | No | ||
| is_enabled | No | ||
| include_raw | No | ||
| display_name | No | ||
| mark_as_read | No | ||
| body_contains | No | ||
| from_addresses | No | ||
| move_to_folder | No | ||
| has_attachments | No | ||
| sender_contains | No | ||
| subject_contains | No | ||
| stop_processing_rules | No | ||
| body_or_subject_contains | No |