---
title: "Conditional S3 Requests"
slug: "conditional-s3-requests-tg"
tags: ["5.5"]
updated: 2026-10-27T23:00:54Z
published: 2026-10-27T23:00:54Z
canonical: "docs.vastdata.com/conditional-s3-requests-tg"
---
> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vastdata.com/llms.txt
> Use this file to discover all available pages before exploring further.
# Conditional S3 Requests
VAST Cluster supports the following types of S3 conditional requests:
- [Conditional Reads](/docs-5-5/docs/conditional-s3-requests-tg#conditional-reads)
- [Conditional Writes](/docs-5-5/docs/conditional-s3-requests-tg#conditional-writes)
- [Conditional Deletes](/docs-5-5/docs/conditional-s3-requests-tg#conditional-deletes)
## Conditional Reads
VAST Cluster's support for [S3 conditional reads](https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-reads.html) includes GetObject and HeadObject requests that contain the `If-Match` HTTP header. The request succeeds only if the object's ETag matches the ETag provided in the request. Otherwise, a error 412 `Precondition Failed` is returned.
For example, to GET an object with an ETag of `6705f2cfc46c0f04559738bb039d59ae`:
```plaintext
GET /myobject HTTP/1.1
If-Match: "6705f2cfc46c0f04559738bb039d59ae"
```
## Conditional Writes
With [S3 conditional writes](https://aws.amazon.com/about-aws/whats-new/2024/08/amazon-s3-conditional-writes/), if a PutObject or CompleteMultipartUpload request contains the `If-None-Match` header and the value is '*', the object is uploaded only if there is no existing object with the same key name in the bucket.
Conditional writes are not supported for versioned buckets.
For example, to PUT an object only on condition that no such object exists in the bucket:
```plaintext
PUT /myobject HTTP/1.1
If-None-Match: *
```
## Conditional Deletes
With [S3 conditional deletes](https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-deletes.html), conditions in `DeleteObject` or `DeleteObjects` requests let you check, prior to the deletion, if the intended object still exists or if it has been overwritten.
Conditional deletes are also supported for versioned objects. If an object in a versioned bucket has a delete marker, a simple DELETE request (the one that does not specify a particular version) against such an object is handled as though the object does not exist.
- To check if the object still exists:.
- For `DeleteObject` : Include the HTTP `If-Match` header with a value of `*`, for example:
```plaintext
DELETE /myobject HTTP/1.1
If-Match: *
```
For a versioned bucket:
```plaintext
DELETE /myobject?versionId=5 HTTP/1.1
If-Match: *
```
- For `DeleteObjects` : Set the object's `ETag` element in the XML request body to `*`, for example:
```plaintext
POST /?delete HTTP/1.1
```
For a versioned bucket:
```plaintext
POST /?delete HTTP/1.1
```
This operation requires `s3:DeleteObject` permissions.
If the object exists, the operation succeeds and the object gets deleted. Otherwise, error code 404 is returned.
- To check if the object has been overwritten:
- For `DeleteObject` : Include the the HTTP `If-Match` header with a value that represents the ETag of the object to be deleted. For example:
```plaintext
DELETE /myobject HTTP/1.1
If-Match: "7f138a09169b250e9dcb378140907378"
```
For a versioned bucket:
```plaintext
DELETE /myobject?versionId=5 HTTP/1.1
If-Match: "7f138a09169b250e9dcb378140907378"
```
- For `DeleteObjects`: Set the object's `ETag` element in the XML request body to the ETag of the object to be deleted. For example:
```plaintext
POST /?delete HTTP/1.1
```
For a versioned bucket:
```plaintext
POST /?delete HTTP/1.1
```
This operation requires `s3:DeleteObject` and `s3:GetObject` permissions.
If the object's ETag matches the ETag in the delete request, the operation succeeds and the object gets deleted. Otherwise, error code 412 is returned.
### Controlling Conditional Deletes with a Bucket Policy
You can configure a bucket policy to only accept a DeleteObject or DeleteObjects request when the request is conditional and includes an eTag, which can be a specific eTag value or the asterisk wildcard (*) for any value. This forces clients to use the `If-Match` HTTP header in their delete requests.
## S3 Conditional Writes
VAST Cluster supports [S3 conditional writes](https://aws.amazon.com/about-aws/whats-new/2024/08/amazon-s3-conditional-writes/). If a PutObject or CompleteMultipartUpload request contains the `If-None-Match` header and the value is '*', the object is uploaded only if there is no existing object with the same key name in the bucket.
Conditional writes are not supported for versioned buckets.
## S3 Conditional Deletes
With [S3 conditional deletes](https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-deletes.html), conditions in `DeleteObject` or `DeleteObjects` requests let you check, prior to the deletion, if the intended object still exists or if it has been overwritten.
Conditional deletes are also supported for versioned objects. If an object in a versioned bucket has a delete marker, a simple DELETE request (the one that does not specify a particular version) against such an object is handled as though the object does not exist.
- To check if the object still exists:.
- For `DeleteObject` : Include the HTTP `If-Match` header with a value of `*`, for example:
```plaintext
DELETE /myobject HTTP/1.1
If-Match: *
```
For a versioned bucket:
```plaintext
DELETE /myobject?versionId=5 HTTP/1.1
If-Match: *
```
- For `DeleteObjects` : Set the object's `ETag` element in the XML request body to `*`, for example:
```plaintext
POST /?delete HTTP/1.1
```
For a versioned bucket:
```plaintext
POST /?delete HTTP/1.1
```
This operation requires `s3:DeleteObject` permissions.
If the object exists, the operation succeeds and the object gets deleted. Otherwise, error code 404 is returned.
- To check if the object has been overwritten:
- For `DeleteObject` : Include the the HTTP `If-Match` header with a value that represents the ETag of the object to be deleted. For example:
```plaintext
DELETE /myobject HTTP/1.1
If-Match: "7f138a09169b250e9dcb378140907378"
```
For a versioned bucket:
```plaintext
DELETE /myobject?versionId=5 HTTP/1.1
If-Match: "7f138a09169b250e9dcb378140907378"
```
- For `DeleteObjects`: Set the object's `ETag` element in the XML request body to the ETag of the object to be deleted. For example:
```plaintext
POST /?delete HTTP/1.1
```
For a versioned bucket:
```plaintext
POST /?delete HTTP/1.1
```
This operation requires `s3:DeleteObject` and `s3:GetObject` permissions.
If the object's ETag matches the ETag in the delete request, the operation succeeds and the object gets deleted. Otherwise, error code 412 is returned.
### Controlling Conditional Deletes with a Bucket Policy
You can configure a bucket policy to only accept a DeleteObject or DeleteObjects request when the request is conditional and includes an eTag, which can be a specific eTag value or the asterisk wildcard (*) for any value. This forces clients to use the `If-Match` HTTP header in their delete requests.