**Full name**: projects.locations.processors.dataset.batchDeleteDocuments

Deletes a set of documents.

### HTTP request

Choose a location:
<button value="global" default="">global</button> <button value="us">us</button> <button value="eu">eu</button> <button value="asia-south1">asia-south1</button> <button value="asia-southeast1">asia-southeast1</button> <button value="northamerica-northeast1">northamerica-northeast1</button> <button value="australia-southeast1">australia-southeast1</button> <button value="europe-west2">europe-west2</button> <button value="europe-west3">europe-west3</button>   
`POST https://documentai.googleapis.com/v1beta3/{dataset}:batchDeleteDocuments`

<br />

### Path parameters

| Parameters ||
|---|---|
| `dataset` | `string` Required. The dataset resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset It takes the form `projects/{project}/locations/{location}/processors/{processor}/dataset`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "datasetDocuments": { object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1beta3/projects.locations.processors.dataset/batchDeleteDocuments#BatchDatasetDocuments`) } } ``` |

| Fields ||
|---|---|
| `datasetDocuments` | ``object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1beta3/projects.locations.processors.dataset/batchDeleteDocuments#BatchDatasetDocuments`)`` Required. Dataset documents input. If given `filter`, all documents satisfying the filter will be deleted. If given documentIds, a maximum of 50 documents can be deleted in a batch. The request will be rejected if more than 50 documentIds are provided. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/document-ai/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `dataset` resource:

- `documentai.datasets.deleteDocuments`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## BatchDatasetDocuments

Dataset documents that the batch operation will be applied to.

| JSON representation |
|---|
| ``` { // Union field `criteria` can be only one of the following: "individualDocumentIds": { object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1beta3/projects.locations.processors.dataset/batchDeleteDocuments#IndividualDocumentIds`) }, "filter": string // End of list of possible types for union field `criteria`. } ``` |

| Fields ||
|---|---|
| Union field `criteria`. `criteria` can be only one of the following: ||
| `individualDocumentIds` | ``object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1beta3/projects.locations.processors.dataset/batchDeleteDocuments#IndividualDocumentIds`)`` Document identifiers. |
| `filter` | `string` A filter matching the documents. Follows the same format and restriction as \[google.cloud.documentai.master.ListDocumentsRequest.filter\]. |

## IndividualDocumentIds

List of individual DocumentIds.

| JSON representation |
|---|
| ``` { "documentIds": [ { object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/Shared.Types/DocumentId`) } ] } ``` |

| Fields ||
|---|---|
| `documentIds[]` | ``object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/Shared.Types/DocumentId`)`` Required. List of Document IDs indicating where the actual documents are stored. |