Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet.
If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted.
It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted.
It's not possible to undo the products.purge operation. Therefore, it is recommended to keep the csv files used in productSets.import (if that was how you originally built the Product Set) before starting products.purge, in case you need to re-import the data after deletion.
If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the products.purge operation has finished for that ProductSet.
The google.longrunning.Operation API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress)
HTTP request
POST https://vision.googleapis.com/v1p4beta1/{parent=projects/*/locations/*}/products:purge
Required. The project and location in which the Products should be deleted.
Format is projects/PROJECT_ID/locations/LOC_ID.
Request body
The request body contains data with the following structure:
JSON representation
{"force": boolean,// Union field target can be only one of the following:"productSetPurgeConfig": {object (ProductSetPurgeConfig)},"deleteOrphanProducts": boolean// End of list of possible types for union field target.}
Fields
force
boolean
The default value is false. Override this value to true to actually perform the purge.
Union field target. The Products to delete. target can be only one of the following:
Config to control which ProductSet contains the Products to be deleted.
JSON representation
{"productSetId": string}
Fields
productSetId
string
The ProductSet that contains the Products to delete. If a Product is a member of productSetId in addition to other ProductSets, the Product will still be deleted.
[[["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."],[],[],null,["# Method: projects.locations.products.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- [ProductSetPurgeConfig](#ProductSetPurgeConfig)\n - [JSON representation](#ProductSetPurgeConfig.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nAsynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet.\n\nIf a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted.\n\nIt is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted.\n\nIt's not possible to undo the products.purge operation. Therefore, it is recommended to keep the csv files used in productSets.import (if that was how you originally built the Product Set) before starting products.purge, in case you need to re-import the data after deletion.\n\nIf the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the products.purge operation has finished for that ProductSet.\n\nThe [google.longrunning.Operation](/vision/docs/reference/rest/v1p4beta1/Operation) API can be used to keep track of the progress and results of the request. `Operation.metadata` contains `BatchOperationMetadata`. (progress)\n\n### HTTP request\n\n`POST https://vision.googleapis.com/v1p4beta1/{parent=projects/*/locations/*}/products:purge`\n\nThe URL uses [gRPC Transcoding](https://github.com/googleapis/googleapis/blob/master/google/api/http.proto) 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](/vision/docs/reference/rest/v1p4beta1/Operation).\n\n### Authorization Scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n- `https://www.googleapis.com/auth/cloud-vision`\n\nFor more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/).\n\nProductSetPurgeConfig\n---------------------\n\nConfig to control which ProductSet contains the Products to be deleted.\n\nTry it!\n-------"]]