putBucketVersioning method
Written by
Updated at September 30, 2024
Enables or pauses versioning of the bucket.
Versioning can be set to one of two statuses:
Enabled
: Turns on version management for objects in the bucket. All new objects added to the bucket will get a unique version ID.Suspended
: Suspends version management for objects in the bucket. All new objects added to the bucket will getnull
for version ID.
For more information on getting started with the API and the general request format, see How to use the S3 API.
Request
PUT /{bucket}?versioning HTTP/2
Path parameters
Parameter | Description |
---|---|
bucket |
Bucket name. |
Query parameters
Parameter | Description |
---|---|
versioning |
Required parameter that indicates the type of operation. |
Data schema
<?xml version="1.0" encoding="UTF-8"?>
<VersioningConfiguration>
<Status>string</Status>
</VersioningConfiguration>
Element | Description |
---|---|
Status |
Bucket versioning status. Type: String The possible values are: Enabled | Suspended |
Headers
Use only common request headers in your requests.
Response
Headers
Responses can only contain common response headers.
Response codes
For a list of possible responses, see Responses.
A successful response does not contain any additional data.