--- title: "PutObjectLegalHold" slug: "ncloudstorage-putobjectlegalhold" updated: 2026-09-17T10:12:27Z published: 2026-09-17T10:12:27Z canonical: "api.ncloud-docs.com/ncloudstorage-putobjectlegalhold" --- > ## Documentation Index > Fetch the complete documentation index at: https://api.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # PutObjectLegalHold Available in Classic and VPC Set or remove the legal hold status set on an Ncloud Storage object. Objects subject to legal hold cannot be deleted or changed, regardless of the retention period. ## Request This section describes the request format. The method and URI are as follows: | Method | URI | | --- | --- | | PUT | /{Key} | ### Request headers The following describes the request headers. Note For information about the headers common to all Ncloud Storage APIs, see [Ncloud Storage request headers](/docs/en/storage-ncloudstorage#%EC%9A%94%EC%B2%AD%ED%97%A4%EB%8D%94). | Field | Required | Description | | --- | --- | --- | | `Content-MD5` | Required | Base64-encoded 128-bit MD5 hash of the request body - Used to verify the integrity of the request body. - Can be replaced with `x-amz-checksum-*` checksum header. | ### Request path parameters You can use the following path parameters with your request: | Field | Type | Required | Description | | --- | --- | --- | --- | | `Key` | String | Required | Object name | ### Request query parameters You can use the following query parameters with your request: | Field | Type | Required | Description | | --- | --- | --- | --- | | `versionId` | String | Optional | Version ID of the object to set the legal hold for - Set to the latest version if not entered. | ### Request body You can include the following data in the body of your request: | Field | Type | Required | Description | | --- | --- | --- | --- | | `LegalHold` | Object | Required | Legal hold settings | | `LegalHold.Status` | String | Required | Legal hold status - `ON` \| `OFF` - `ON`: Enabled - `OFF`: Disabled | ### Request example The request example is as follows: ``` PUT /object.csv?legal-hold HTTP/1.1 Host: {Bucket}.kr.ncloudstorage.com Content-MD5: {MD5 hash value} ON ``` ## Response This section describes the response format. ### Response headers For information about the headers common to all Ncloud Storage APIs, see [Ncloud Storage response headers](/docs/en/storage-ncloudstorage#%EC%9D%91%EB%8B%B5%ED%97%A4%EB%8D%94). ### Response status codes The following describes the response status codes. Note For information about the HTTP status codes common to all Ncloud Storage APIs, see [Common Ncloud Storage response status codes](/docs/en/storage-ncloudstorage#%EC%9D%91%EB%8B%B5%EC%83%81%ED%83%9C%EC%BD%94%EB%93%9C). | Error code | HTTP status code | Description | | --- | --- | --- | | `InvalidRequest` | 400 | No object lock settings exist in the bucket. | | `MalformedXML` | 400 | The request body XML does not conform to the schema. - `Status` is not `ON`/`OFF`. | | `NoSuchKey` | 404 | Specified object does not exist. | | `NoSuchVersion` | 404 | Specified version does not exist. | | `MethodNotAllowed` | 405 | Legal hold is set on a deletion marker. | ### Response example The response example is as follows: ``` HTTP/1.1 200 OK ```