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)},"inlineSource": {object (InlineSource)}// 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).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-27 UTC."],[[["\u003cp\u003eThis operation permanently deletes selected Documents within a specified branch, and it runs asynchronously, which can take hours to complete depending on the number of documents.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request for this operation is a POST request to a specific URL that includes parameters to identify the parent resource location such as projects, locations, collections, dataStores, and branch.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires parameters, such as \u003ccode\u003efilter\u003c/code\u003e to determine which documents to purge, \u003ccode\u003eerrorConfig\u003c/code\u003e for handling purge errors, and \u003ccode\u003eforce\u003c/code\u003e to initiate the purge or just get a count of potential deletes, and \u003ccode\u003esource\u003c/code\u003e to identify the method to obtain the documents.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful requests return an Operation instance in the response body.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires the \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope, and the operation also requires the \u003ccode\u003ediscoveryengine.documents.purge\u003c/code\u003e IAM permission on the parent resource.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.collections.dataStores.branches.documents.purge\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [IAM Permissions](#body.aspect_1)\n\nPermanently deletes all selected [Document](/generative-ai-app-builder/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents#Document)s in a branch.\n\nThis process is asynchronous. Depending on the number of [Document](/generative-ai-app-builder/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents#Document)s to be deleted, this operation can take hours to complete. Before the delete operation completes, some [Document](/generative-ai-app-builder/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents#Document)s might still be returned by [DocumentService.GetDocument](/generative-ai-app-builder/docs/reference/rest/v1alpha/projects.locations.dataStores.branches.documents/get#google.cloud.discoveryengine.v1alpha.DocumentService.GetDocument) or [DocumentService.ListDocuments](/generative-ai-app-builder/docs/reference/rest/v1alpha/projects.locations.dataStores.branches.documents/list#google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments).\n\nTo get a list of the [Document](/generative-ai-app-builder/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents#Document)s to be deleted, set [PurgeDocumentsRequest.force](/generative-ai-app-builder/docs/reference/rest/v1alpha/projects.locations.dataStores.branches.documents/purge#body.request_body.FIELDS.force) to false.\n\n### HTTP request\n\n`POST https://discoveryengine.googleapis.com/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:purge`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/generative-ai-app-builder/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp).\n\n### IAM Permissions\n\nRequires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:\n\n- `discoveryengine.documents.purge`\n\nFor more information, see the [IAM documentation](https://cloud.google.com/iam/docs)."]]