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 API operation permanently deletes selected Documents within a specified branch, using an asynchronous process that may take hours to complete.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request is a \u003ccode\u003ePOST\u003c/code\u003e to a specific URL that includes path parameters defining the parent resource, such as project, location, data store, and branch.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires a \u003ccode\u003efilter\u003c/code\u003e to select documents to purge, supports error handling via \u003ccode\u003eerrorConfig\u003c/code\u003e, and offers a \u003ccode\u003eforce\u003c/code\u003e field to control whether deletion is actually performed or is only a simulation.\u003c/p\u003e\n"],["\u003cp\u003eThe request body can be supplemented with the inclusion of a source (either \u003ccode\u003egcsSource\u003c/code\u003e or \u003ccode\u003einlineSource\u003c/code\u003e), which define the input source for purging documents based on document IDs.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization to use this API requires the \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope and the \u003ccode\u003ediscoveryengine.documents.purge\u003c/code\u003e IAM permission on the parent resource.\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/v1beta/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/v1beta/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/v1beta/projects.locations.collections.dataStores.branches.documents#Document)s might still be returned by [DocumentService.GetDocument](/generative-ai-app-builder/docs/reference/rest/v1beta/projects.locations.dataStores.branches.documents/get#google.cloud.discoveryengine.v1beta.DocumentService.GetDocument) or [DocumentService.ListDocuments](/generative-ai-app-builder/docs/reference/rest/v1beta/projects.locations.dataStores.branches.documents/list#google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments).\n\nTo get a list of the [Document](/generative-ai-app-builder/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document)s to be deleted, set [PurgeDocumentsRequest.force](/generative-ai-app-builder/docs/reference/rest/v1beta/projects.locations.dataStores.branches.documents/purge#body.request_body.FIELDS.force) to false.\n\n### HTTP request\n\n`POST https://discoveryengine.googleapis.com/v1beta/{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)."]]