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/v1alpha/{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,
  "errorConfig": {
    object (PurgeErrorConfig)
  },
  "force": boolean,

  // Union field source can be only one of the following:
  "gcsSource": {
    object (GcsSource)
  }
  // End of list of possible types for union field source.
}
Fields
filter

string

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

errorConfig

object (PurgeErrorConfig)

The desired location of errors incurred during the purge.

force

boolean

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

Union field source. The desired input source for the purging documents based on document ids. source can be only one of the following:
gcsSource

object (GcsSource)

Cloud Storage location for the input content. Supported dataSchema: * documentId: One valid Document.id per line.

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.