gmail.users.messages.batchModify
Modify labels and classification label values on specified Gmail messages in bulk by adding or removing label IDs and classification labels for a user.
Instructions
Modifies the labels and the Classification Label values on the specified messages. For administrators modifying messages 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 BatchModifyMessagesRequest object accepting addClassificationLabels, addLabelIds, ids, removeClassificationLabelIds, removeLabelIds; pass it via params or whole via body_file Siblings over the same resource: batchDelete, delete, get, import, insert, list, modify, send, trash, untrash.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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 BatchModifyMessagesRequest object. | |
| request_body | No | Request body of type BatchModifyMessagesRequest: pass it via `params` (merged into the built body) or whole via `body_file`. |