putObjectLegalHold method
Written by
Updated at January 17, 2023
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 put or remove legal hold. To check the lock, use the getObjectLegalHold method.
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. Required parameter. |
Headers
Use the necessary common request headers in requests.
Data schema
<LegalHold xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Status>string</Status>
</LegalHold>
Element | Description |
---|---|
Status |
Status of legal hold:
Path: |
Response
Headers
Responses can only contain common response headers.
Response codes
For a list of possible responses, see Responses.