Requires authorization
Modifies the labels on the specified messages. Try it now.
Request
HTTP request
POST https://www.googleapis.com/gmail/v1/users/userId/messages/batchModify
Parameters
Parameter name | Value | Description |
---|---|---|
Path parameters | ||
userId |
string |
The user's email address. The special value me
can be used to indicate the authenticated user.
|
Authorization
This request requires authorization with at least one of the following scopes (read more about authentication and authorization).
Scope |
---|
https://mail.google.com/ |
https://www.googleapis.com/auth/gmail.modify |
Request body
In the request body, supply data with the following structure:
{ "ids": [ string ], "addLabelIds": [ string ], "removeLabelIds": [ string ] }
Property name | Value | Description | Notes |
---|---|---|---|
ids[] |
list |
The IDs of the messages to modify. There is a limit of 1000 ids per request. | |
addLabelIds[] |
list |
A list of label IDs to add to messages. | |
removeLabelIds[] |
list |
A list of label IDs to remove from messages. |
Response
If successful, this method returns an empty response body.
Try it!
Use the APIs Explorer below to call this method on live data and see the response.