Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the
bucket, or if the `generation` parameter is used.

When this API is used to delete an object from a bucket with a
[soft delete policy](https://docs.cloud.google.com/storage/docs/soft-delete.md.txt), the object becomes soft deleted, and the
`softDeleteTime` and `hardDeleteTime` properties are set on the
[object](https://docs.cloud.google.com/storage/docs/json_api/v1/objects.md.txt#resource). This
API cannot be used to permanently delete soft-deleted objects. Soft-deleted objects
are permanently deleted according to their `hardDeleteTime`. Attempting to delete
soft-deleted objects using this API results in a `404 Not Found` error with the reason
`notFound`.

## Required permissions

The authenticated user must have the `storage.objects.delete` IAM
permission to use this method.

## Request

### HTTP request

```
DELETE https://storage.googleapis.com/storage/v1/b/bucket/o/object
```

In addition to [standard query parameters](https://docs.cloud.google.com/storage/docs/json_api/v1/parameters.md.txt#query),
the following query parameters apply to this method.

To see an example of how to include query parameters in a request, see the
[JSON API Overview](https://docs.cloud.google.com/storage/docs/json_api.md.txt#query_parameters) page.

### 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, see [Encoding URI path parts](https://docs.cloud.google.com/storage/docs/request-endpoints.md.txt#encoding). |
| **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 the
[reference page](https://docs.cloud.google.com/storage/docs/json_api/v1/status-codes.md.txt).

## Try it!

Use the APIs Explorer below to call this method on live data and see the response.