

# PutBucketDefaultStorageClass

**Note**  
This operation is not supported for directory buckets.

Sets the default storage class of the general purpose bucket. Amazon S3 uses the default storage class for new objects that you write to the bucket without the `x-amz-storage-class` request header. A storage class that you specify on the write request takes precedence over the bucket default. For more information, see [Setting the default storage class for a bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucket-default-storage-class.html) in the *Amazon S3 User Guide*.

Changing the default storage class applies only to objects that you write after you change it. Amazon S3 doesn't change the storage class of objects that are already in the bucket. There is no operation to delete the default storage class. To revert the bucket to its original default, set the storage class to `STANDARD`.

To use this operation, you must have the `s3:PutBucketDefaultStorageClass` permission.

The following operations are related to `PutBucketDefaultStorageClass`:
+  [GetBucketDefaultStorageClass](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketDefaultStorageClass.html) 
+  [PutObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) 
+  [CopyObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html) 
+  [CreateMultipartUpload](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) 

## Request Syntax
<a name="API_PutBucketDefaultStorageClass_RequestSyntax"></a>

```
PUT /?default-storage-class HTTP/1.1
Host: {{Bucket}}.s3.amazonaws.com
Content-MD5: {{ContentMD5}}
x-amz-sdk-checksum-algorithm: {{ChecksumAlgorithm}}
x-amz-expected-bucket-owner: {{ExpectedBucketOwner}}
<?xml version="1.0" encoding="UTF-8"?>
<DefaultStorageClassConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
   <DefaultStorageClass>{{string}}</DefaultStorageClass>
</DefaultStorageClassConfiguration>
```

## URI Request Parameters
<a name="API_PutBucketDefaultStorageClass_RequestParameters"></a>

The request uses the following URI parameters.

 ** [Bucket](#API_PutBucketDefaultStorageClass_RequestSyntax) **   <a name="AmazonS3-PutBucketDefaultStorageClass-request-header-Bucket"></a>
The name of the general purpose bucket.  
Required: Yes

 ** [Content-MD5](#API_PutBucketDefaultStorageClass_RequestSyntax) **   <a name="AmazonS3-PutBucketDefaultStorageClass-request-header-ContentMD5"></a>
The MD5 hash of the `PutBucketDefaultStorageClass` request body.  
For requests made using the AWS Command Line Interface (CLI) or AWS SDKs, this field is calculated automatically.

 ** [x-amz-expected-bucket-owner](#API_PutBucketDefaultStorageClass_RequestSyntax) **   <a name="AmazonS3-PutBucketDefaultStorageClass-request-header-ExpectedBucketOwner"></a>
The AWS account ID of the general purpose bucket's owner.

 ** [x-amz-sdk-checksum-algorithm](#API_PutBucketDefaultStorageClass_RequestSyntax) **   <a name="AmazonS3-PutBucketDefaultStorageClass-request-header-ChecksumAlgorithm"></a>
Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see [ Checking object integrity](https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) in the *Amazon S3 User Guide*.  
Valid Values: `CRC32 | CRC32C | SHA1 | SHA256 | CRC64NVME | SHA512 | MD5 | XXHASH64 | XXHASH3 | XXHASH128` 

## Request Body
<a name="API_PutBucketDefaultStorageClass_RequestBody"></a>

The request accepts the following data in XML format.

 ** [DefaultStorageClassConfiguration](#API_PutBucketDefaultStorageClass_RequestSyntax) **   <a name="AmazonS3-PutBucketDefaultStorageClass-request-DefaultStorageClassConfiguration"></a>
Root level tag for the DefaultStorageClassConfiguration parameters.  
Required: Yes

 ** [DefaultStorageClass](#API_PutBucketDefaultStorageClass_RequestSyntax) **   <a name="AmazonS3-PutBucketDefaultStorageClass-request-DefaultStorageClass"></a>
The default storage class of the general purpose bucket. Valid values are `STANDARD` and `INTELLIGENT_TIERING`.  
Type: String  
Valid Values: `STANDARD | INTELLIGENT_TIERING`   
Required: Yes

## Response Syntax
<a name="API_PutBucketDefaultStorageClass_ResponseSyntax"></a>

```
HTTP/1.1 200
```

## Response Elements
<a name="API_PutBucketDefaultStorageClass_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

## See Also
<a name="API_PutBucketDefaultStorageClass_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/s3-2006-03-01/PutBucketDefaultStorageClass) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/s3-2006-03-01/PutBucketDefaultStorageClass) 
+  [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/s3-2006-03-01/PutBucketDefaultStorageClass) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/s3-2006-03-01/PutBucketDefaultStorageClass) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/s3-2006-03-01/PutBucketDefaultStorageClass) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/s3-2006-03-01/PutBucketDefaultStorageClass) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/s3-2006-03-01/PutBucketDefaultStorageClass) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/s3-2006-03-01/PutBucketDefaultStorageClass) 
+  [AWS SDK for Python (Boto3)](https://docs.aws.amazon.com/goto/boto3/s3-2006-03-01/PutBucketDefaultStorageClass) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/s3-2006-03-01/PutBucketDefaultStorageClass) 