Change labels
modify_labelsAdd or remove Gmail labels on selected messages or an entire thread to mark mail read, unread, archived, starred, or filed. Use label names or IDs; TRASH and SPAM cannot be changed.
Instructions
Add or remove labels on specific messages, or on every message of a thread. This is how to mark read (remove UNREAD), mark unread (add UNREAD), archive (remove INBOX), star (add STARRED), or file mail under a label. Labels are names in any case, or ids from list_labels; unknown names return an error, and create_label makes new ones. Returns the account and the label ids that were added and removed. Only for accounts connected with --labels (otherwise the error says how to enable it). TRASH and SPAM are refused, so nothing can be deleted or marked as spam.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| add | No | Labels to add. | |
| remove | No | Labels to remove. | |
| account | No | Which mailbox: email address, alias, or local part. Optional when only one account is connected. | |
| thread_id | No | Change every message in this thread instead. | |
| message_ids | No | Message ids to change. |