- [HTTP request](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/batchDelete#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/batchDelete#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/batchDelete#body.request_body)
  - [JSON representation](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/batchDelete#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/batchDelete#body.response_body)
- [Authorization scopes](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/batchDelete#body.aspect)
- [Try it!](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/batchDelete#try-it)

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](https://google.aip.dev/127) 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](https://developers.google.com/workspace/guides/configure-oauth-consent).