getObjectLockConfiguration method
Returns the settings of object locks for a versioned bucket.
For more information on getting started with the API and the general request format, see How to use the S3 API.
Request
GET /{bucket}?object-lock HTTP/2
Path parameters
| Parameter | Description |
|---|---|
bucket |
Bucket name. |
Headers
Use only common headers in your requests.
Response
Headers
Responses can only contain common headers.
Response codes
For a list of possible responses, see Responses.
Data schema
<ListBucketResult
xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<KeyCount>1</KeyCount>
<Name>my-sample-bucket</Name>
<Prefix></Prefix>
<MaxKeys>1000</MaxKeys>
<IsTruncated>false</IsTruncated>
<Contents>
<Key>text.txt</Key>
<LastModified>2025-05-15T07:23:08.030Z</LastModified>
<Owner>
<ID>ajegtlf2q28a********</ID>
<DisplayName>ajegtlf2q28a********</DisplayName>
</Owner>
<ETag>"f75a361db63aa4722fb8e083********"</ETag>
<Size>103</Size>
<StorageClass>STANDARD</StorageClass>
<TagSet></TagSet>
</Contents>
</ListBucketResult>
| Element | Description |
|---|---|
ObjectLockEnabled |
Object lock status:
If the element is not specified, object locks are disabled. Path: |
Rule |
Lock settings. Path: |
DefaultRetention |
Default lock settings. Path: |
Mode |
Default retention type:
Path: |
Days |
Default retention period in days since the object version upload. It must be a positive integer. Path: |
Years |
Default retention period in years since the object version upload. It must be a positive integer. Path: |