--- title: "put-object-legal-hold" slug: "put-object-legal-hold" updated: 2026-10-08T05:00:24Z published: 2026-10-08T05:00:24Z canonical: "cli.ncloud-docs.com/put-object-legal-hold" --- > ## Documentation Index > Fetch the complete documentation index at: https://cli.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # put-object-legal-hold Available in Classic and VPC Set or remove a legal hold on an Ncloud Storage object. Objects under a legal hold cannot be deleted or changed regardless of their retention period. Note For a Sub Account user to execute this command, they must have the Change/PutObjectLegalHold action permission. ## Syntax The `put-object-legal-hold` syntax is as follows: ``` aws s3api put-object-legal-hold \ --bucket \ --key \ --legal-hold \ [--version-id ] \ [--content-md5 ] \ [--checksum-algorithm ] \ --endpoint-url ``` ## Options This section describes the options available when running `put-object-legal-hold`. ### Required options The following options are required for `put-object-legal-hold`. | Options | Type | Required | Description | | --- | --- | --- | --- | | `--bucket` | String | Required | Bucket name | | `--key` | String | Required | Object name | | `--legal-hold` | String | Required | Legal hold settings - Enter in JSON format. - `Status`: Whether to apply the legal hold. - `ON` \| `OFF` | ### Optional options These are the optional options for `put-object-legal-hold`. Options that are not specified will use their default values. | Options | Type | Required | Description | | --- | --- | --- | --- | | `--version-id` | String | Optional | Object version ID | | `--content-md5` | String | Optional | Base64-encoded 128-bit MD5 hash of the request data - Used to validate the integrity of the request data - Calculated automatically if not entered | | `--checksum-algorithm` | String | Optional | Checksum algorithm used to validate the request data - `CRC32` \| `CRC32C` \| `SHA1` \| `SHA256` \| `CRC64NVME` | ### Common options For information about the options common to all `aws` subcommands, see [Ncloud Storage options](/docs/en/storage-ncloudstorage#%EC%98%B5%EC%85%98). ## Examples If the request to set legal retention is successful, the settings are applied, and no result is displayed. ### Command The command example is as follows: ``` aws s3api put-object-legal-hold --bucket my-locked-bucket \ --key locked.txt \ --legal-hold Status=ON \ --endpoint-url=https://kr.ncloudstorage.com ``` ## Related commands Related commands are as follows: - [put-object-lock-configuration](/docs/en/put-object-lock-configuration) - [get-object-lock-configuration](/docs/en/get-object-lock-configuration) - [put-object-retention](/docs/en/put-object-retention) - [get-object-retention](/docs/en/get-object-retention) - [get-object-legal-hold](/docs/en/get-object-legal-hold)