--- title: "PutObjectLockConfiguration" slug: "ncloudstorage-putobjectlockconfiguration" updated: 2026-09-17T10:12:30Z published: 2026-09-17T10:12:30Z canonical: "api.ncloud-docs.com/ncloudstorage-putobjectlockconfiguration" --- > ## 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. # PutObjectLockConfiguration Available in Classic and VPC Apply object lock settings on an Ncloud Storage bucket. With object lock, you can preserve objects so that they cannot be deleted or modified for a specified period or indefinitely. ## Request This section describes the request format. The method and URI are as follows: | Method | URI | | --- | --- | | PUT | - | ### 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` | Conditional | Base64-encoded 128-bit MD5 hash of the request body - Used to verify the integrity of the request body. - Required if `x-amz-checksum-*` is not entered. | | `x-amz-checksum-*` | Conditional | Checksum hash value - Enter the used algorithm in `*` of the key. - Supported algorithms: `crc32` \| `crc32c` \| `sha1` \| `sha256` \| `crc64nvme` - Required if `Content-MD5` is not entered. | ### Request body You can include the following data in the body of your request: | Field | Type | Required | Description | | --- | --- | --- | --- | | `ObjectLockConfiguration` | Object | Required | Object lock settings | | `ObjectLockConfiguration.ObjectLockEnabled` | String | Required | Whether object lock is enabled - `Enabled` (valid value) | | `ObjectLockConfiguration.Rule` | Object | Optional | Default retention rule - If not specified, the default retention period is not set. | | `ObjectLockConfiguration.Rule.DefaultRetention` | Object | Optional | Default retention settings - Required if `Rule` is set | | `ObjectLockConfiguration.Rule.DefaultRetention.Mode` | String | Optional | Default retention mode - `GOVERNANCE` \| `COMPLIANCE` - `GOVERNANCE`: Can be bypassed with special permissions. - `COMPLIANCE`: No one can bypass it. | | `ObjectLockConfiguration.Rule.DefaultRetention.Days` | Integer | Optional | Default retention period (days) - 1-36,500 - Can't be specified simultaneously with `Years` (select one). | | `ObjectLockConfiguration.Rule.DefaultRetention.Years` | Integer | Optional | Default retention period (years) - 1-100 - Can't be specified simultaneously with `Days` (select one). | ### Request example The request example is as follows: ``` PUT /?object-lock HTTP/1.1 Host: {Bucket}.kr.ncloudstorage.com Content-MD5: {MD5 hash value} Enabled GOVERNANCE 30 ``` ## 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 | | --- | --- | --- | | `InvalidArgument` | 400 | The default retention period is outside the valid range. - `Days`/`Years` is not a positive integer. - `Days` (36,500)/`Years` (100) exceeds the limit. | | `MalformedXML` | 400 | The request body XML does not conform to the schema. - `ObjectLockEnabled` is not `Enabled`. - `Mode` is not `GOVERNANCE`/`COMPLIANCE`. - `Days` and `Years` are specified simultaneously or neither is specified. | ### Response example The response example is as follows: ``` HTTP/1.1 200 OK ```