putObjectLegalHold method
Written by
Updated at September 30, 2024
Puts or removes legal hold for an object version.
To be able to put locks on object versions, enable object lock in the bucket. For this, use the putObjectLockConfiguration method.
Users with the storage.uploader
role can place or release a legal hold. To check a legal hold, use the getObjectLegalHold method.
For more information on getting started with the API and the general request format, see How to use the S3 API.
Request
PUT /{bucket}/{key}?legal-hold&versionId={versionId} HTTP/2
Path parameters
Parameter | Description |
---|---|
bucket |
Bucket name. |
key |
Object key. |
Query parameters
Parameter | Description |
---|---|
legal-hold |
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.
Data schema
<LegalHold xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Status>string</Status>
</LegalHold>
Element | Description |
---|---|
Status |
Legal hold status:
Path: |
Response
Headers
Responses can only contain common response headers.
Response codes
For a list of possible responses, see Responses.