getObjectRetention method
Written by
Updated at March 19, 2025
Returns settings of the retention put on an object version.
For more information on getting started with the API and the general request format, see How to use the S3 API.
Request
GET /{bucket}/{key}?retention&versionId={versionId} HTTP/2
Path parameters
Parameter | Description |
---|---|
bucket |
Bucket name. |
key |
Object key. |
Request parameters
Parameter | Description |
---|---|
retention |
Required parameter that indicates the type of operation. |
versionId |
Object version ID. This is a required parameter. |
Headers
Use the appropriate common headers in your request.
Response
Headers
Responses can only contain common headers.
Response codes
For a list of possible responses, see Responses.
Data schema
<Retention xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Mode>string</Mode>
<RetainUntilDate>timestamp</RetainUntilDate>
</Retention>
Element | Description |
---|---|
Mode |
Retention type:
Path: |
RetainUntilDate |
Retention expiration date and time in RFC3339 Path: |