Method: users.messages.batchDelete
Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all.
HTTP request
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/batchDelete
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
userId |
string
The user's email address. The special value me can be used to indicate the authenticated user.
|
Request body
The request body contains data with the following structure:
JSON representation |
{
"ids": [
string
]
} |
Fields |
ids[] |
string
The IDs of the messages to delete.
|
Response body
If successful, the response body is empty.
Authorization scopes
Requires the following OAuth scope:
For more information, see the Authorization guide.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-04 UTC.
[null,null,["Last updated 2024-09-04 UTC."],[[["This endpoint allows you to delete multiple messages in Gmail by providing a list of message IDs."],["The request is sent as a POST request to a specific URL with the user's email address as a path parameter."],["The request body requires a JSON object containing an array of message IDs to be deleted."],["Although it doesn't guarantee the existence or prior deletion status of the messages, it efficiently processes bulk message deletions."],["Proper authorization with the `https://mail.google.com/` scope is necessary for successful execution."]]],[]]