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, potentially taking hours to complete depending on the number of Documents being deleted.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request for this operation is a POST request directed to a specific URL using gRPC Transcoding syntax, with the required path parameter being the parent resource name.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires a filter to select documents to delete (currently only supports '*'), an error configuration object, and a force field that, when set to false, allows you to preview the purge without deleting.\u003c/p\u003e\n"],["\u003cp\u003eThere is a Union Field \u003ccode\u003esource\u003c/code\u003e that defines where the document IDs are coming from, either through a \u003ccode\u003egcsSource\u003c/code\u003e for Cloud Storage or \u003ccode\u003einlineSource\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe operation requires the \u003ccode\u003ediscoveryengine.documents.purge\u003c/code\u003e IAM permission on the parent resource and the \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope for authorization.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.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/v1/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/v1/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/v1/projects.locations.collections.dataStores.branches.documents#Document)s might still be returned by [DocumentService.GetDocument](/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.dataStores.branches.documents/get#google.cloud.discoveryengine.v1.DocumentService.GetDocument) or [DocumentService.ListDocuments](/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.dataStores.branches.documents/list#google.cloud.discoveryengine.v1.DocumentService.ListDocuments).\n\nTo get a list of the [Document](/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.dataStores.branches.documents#Document)s to be deleted, set [PurgeDocumentsRequest.force](/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.dataStores.branches.documents/purge#body.request_body.FIELDS.force) to false.\n\n### HTTP request\n\n`POST https://discoveryengine.googleapis.com/v1/{parent=projects/*/locations/*/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)."]]