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/v1/{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,

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "gcsSource": {
    object (GcsSource)
  },
  "inlineSource": {
    object (InlineSource)
  }
  // End of mutually exclusive fields.
}
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.

The desired input source for the purging documents based on document IDs. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
gcsSource

object (GcsSource)

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

inlineSource

object (InlineSource)

Inline source for the input content for purge.

End of mutually exclusive fields.

Response body

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

Authorization scopes

Requires one of the following OAuth scopes:

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

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.