Method: projects.locations.collections.dataStores.branches.documents.purge

Permanently deletes all selected Documents in a branch.

This process is asynchronous. Depending on the number of Documents to be deleted, this operation can take hours to complete. Before the delete operation completes, some Documents might still be returned by DocumentService.GetDocument or DocumentService.ListDocuments.

To get a list of the Documents to be deleted, set PurgeDocumentsRequest.force to false.

HTTP request

POST https://discoveryengine.googleapis.com/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:purge

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. The parent resource name, such as projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}/branches/{branch}.

Request body

The request body contains data with the following structure:

JSON representation
{
  "filter": string,
  "force": boolean
}
Fields
filter

string

Required. Filter matching documents to purge. Only currently supported value is * (all items).

force

boolean

Actually performs the purge. If force is set to false, return the expected purge count without deleting any documents.

Response body

If successful, the response body contains an instance of Operation.

Authorization scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the parent resource:

  • discoveryengine.documents.purge

For more information, see the IAM documentation.