gmail.users.messages.modify
Update a specific Gmail message by adding or removing label IDs and classification label values.
Instructions
Modifies the labels and the Classification Label values on the specified message. For administrators modifying message for users in their organization, requests require authorization with a service account that has domain-wide delegation authority to impersonate users with the https://www.googleapis.com/auth/gmail.modify.restricted scope [HTTP POST] — creates or triggers a change; refused under --readonly safety profiles. Returns the API's response resource as JSON — request body is a JSON ModifyMessageRequest object accepting addClassificationLabels, addLabelIds, removeClassificationLabelIds, removeLabelIds; pass it via params or whole via body_file Siblings over the same resource: batchDelete, batchModify, delete, get, import, insert, list, send, trash, untrash.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | [URL path segment] The ID of the message to modify. | |
| query | No | Extra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe. | |
| params | No | Parameter map merged into the request; typed parameters win. | |
| userId | Yes | [URL path segment] The user's email address. The special value `me` can be used to indicate the authenticated user. | me |
| dry_run | No | Return the request that would be sent, without sending it. | |
| body_file | No | Read the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON ModifyMessageRequest object. | |
| request_body | No | Request body of type ModifyMessageRequest: pass it via `params` (merged into the built body) or whole via `body_file`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| raw | No | ||
| payload | No | ||
| snippet | No | ||
| labelIds | No | ||
| threadId | No | ||
| historyId | No | ||
| internalDate | No | ||
| sizeEstimate | No | ||
| classificationLabelValues | No |