apply-category
Categorize email messages by setting, adding, or removing master categories. Supports single or batch messages for efficient organization.
Instructions
Tag or untag email messages with master categories (those created via manage-category). action=set (default) replaces the message's category set with the supplied categories array. action=add appends categories to whatever's already on the message. action=remove removes only the named categories, leaving the rest. Accepts either messageId (single) or messageIds (batch via Graph $batch). categories are matched by display name — names must already exist in the master list (create via manage-category first). Returns per-message confirmation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| messageId | No | Single message ID to categorise | |
| messageIds | No | Array of message IDs to categorise (batch operation) | |
| categories | Yes | Category display names to apply/remove (required) | |
| action | No | set (replace all), add (append), remove (remove specific). Default: set |