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:

  • https://mail.google.com/

For more information, see the Authorization guide.