S3 · Versioning & retention
PutBucketVersioning
/{bucket}?versioningTurns versioning on or off for a bucket.
With versioning on, a write or a delete keeps the earlier version of the key. Suspended stops that. Versions that exist stay.
- Role
- Editor or higher
- Support
- Partial
- Send Enabled or Suspended. Storage ignores MfaDelete.
Path parameters
The bucket name.
Query parameters
Selects this operation. Send it with no value.
Headers
The workspace ID that must own the bucket. Another owner returns 403 AccessDenied.
Request body
The root element.
Responses
200OK
Storage changed the state.
This response has no body.
Errors
Select an error in the response example to see its XML body. Any request can also get the common errors, such as SignatureDoesNotMatch.
- 404NoSuchBucket
No bucket has this name, or the bucket was deleted.
What to do: Check the bucket name. ListBuckets shows the buckets of the workspace.
- 403AccessDenied
The key does not have the role for this operation, or the bucket is in another workspace.
What to do: Use a key of the workspace that owns the bucket, with the role above.