Stay organized with collectionsSave and categorize content based on your preferences.
Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the
bucket, or if thegenerationparameter is used.
When this API is used to delete an object from a bucket with asoft delete policy, the object becomes soft deleted, and thesoftDeleteTimeandhardDeleteTimeproperties are set on theobject. This
API cannot be used to permanently delete soft-deleted objects. Soft-deleted objects
are permanently deleted according to theirhardDeleteTime. Attempting to delete
soft-deleted objects using this API results in a404 Not Founderror with the reasonnotFound.
Required permissions
The authenticated user must have thestorage.objects.deleteIAM
permission to use this method.
To see an example of how to include query parameters in a request, see theJSON API Overviewpage.
Parameters
Parameter name
Value
Description
Path parameters
bucket
string
Name of the bucket in which the object resides.
object
string
Name of the object. For information about how to URL encode object names to be path safe,
seeEncoding URI path parts.
Optional query parameters
generation
long
If present, permanently deletes a specific revision of this object (as opposed to the
latest version, the default).
ifGenerationMatch
long
Makes the operation conditional on whether the object's current generation matches the
given value. Setting to 0 makes the operation succeed only if there are no live versions
of the object.
ifGenerationNotMatch
long
Makes the operation conditional on whether the object's current generation does not match
the given value. If no live object exists, the precondition fails. Setting to 0 makes the
operation succeed only if there is a live version of the object.
ifMetagenerationMatch
long
Makes the operation conditional on whether the object's current metageneration matches
the given value.
ifMetagenerationNotMatch
long
Makes the operation conditional on whether the object's current metageneration does not
match the given value.
Request body
Do not supply a request body with this method.
Response
If successful, this method returns an empty response body.
For information about status and error codes returned by this API, see thereference page.
Try it!
Use the APIs Explorer below to call this method on live data and see the response.
[[["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-09-04 UTC."],[],[],null,["# Objects: delete\n\nDeletes an object and its metadata. Deletions are permanent if versioning is not enabled for the\nbucket, or if the `generation` parameter is used.\n\nWhen this API is used to delete an object from a bucket with a\n[soft delete policy](/storage/docs/soft-delete), the object becomes soft deleted, and the\n`softDeleteTime` and `hardDeleteTime` properties are set on the\n[object](/storage/docs/json_api/v1/objects#resource). This\nAPI cannot be used to permanently delete soft-deleted objects. Soft-deleted objects\nare permanently deleted according to their `hardDeleteTime`. Attempting to delete\nsoft-deleted objects using this API results in a `404 Not Found` error with the reason\n`notFound`.\n\nRequired permissions\n--------------------\n\nThe authenticated user must have the `storage.objects.delete` IAM\npermission to use this method.\n\nRequest\n-------\n\n### HTTP request\n\n```\nDELETE https://storage.googleapis.com/storage/v1/b/bucket/o/object\n```\n\nIn addition to [standard query parameters](/storage/docs/json_api/v1/parameters#query),\nthe following query parameters apply to this method.\n\nTo see an example of how to include query parameters in a request, see the\n[JSON API Overview](/storage/docs/json_api#query_parameters) page.\n\n### Parameters\n\n### Request body\n\nDo not supply a request body with this method.\n\nResponse\n--------\n\nIf successful, this method returns an empty response body.\n\nFor information about status and error codes returned by this API, see the\n[reference page](/storage/docs/json_api/v1/status-codes).\n\nTry it!\n-------\n\nUse the APIs Explorer below to call this method on live data and see the response."]]