Available in Classic and VPC
Register a new lifecycle rule on an Ncloud Storage bucket or overwrite an existing lifecycle rule.
The expiration feature has been enabled since February 26, 2026.
Request
This section describes the request format. The method and URI are as follows:
| Method | URL |
|---|---|
| PUT | - |
Request headers
For information about the headers common to all Ncloud Storage APIs, see Ncloud Storage request headers.
Request body
You can include the following data in the body of your request:
| Field | Type | Required | Description |
|---|---|---|---|
| Rule | List | Required | Rule list
|
| Rule.ID | String | Optional | Rule name
|
| Rule.Filter | List | Optional | Filter to distinguish which objects to apply the rule to |
| Rule.Filter.Prefix | String | Optional | Prefix of the object to apply the rule to, currently only filterable by prefix |
| Rule.Expiration | List | Optional | Expiration rule |
| Rule.Expiration.Days | Integer | Optional | Number of days the object is deleted after being created, which must be a positive integer greater than 0 |
| Rule.Transition | List | Optional | Storage class migration rule |
| Rule.Transition.Days | Integer | Optional | Number of days after the object is created that it is switched to the specified storage class, which must be a positive integer |
| Rule.Transition.StorageClass | String | Optional | Storage class to be switched to
|
| Rule.NoncurrentVersionExpiration | List | Optional | Expiration rule for non-current object versions |
| Rule.NoncurrentVersionExpiration.NewerNoncurrentVersions | Integer | Optional | Number of non-current versions to archive
|
| Rule.NoncurrentVersionExpiration.NoncurrentDays | Integer | Optional | Number of days the object remains noncurrent
|
| Rule.NoncurrentVersionTransition | List | Optional | Storage class migration rule for non-current object versions |
| Rule.NoncurrentVersionTransition.NewerNoncurrentVersions | Integer | Optional | Number of non-current versions to keep in the same storage class before switching the object
|
| Rule.NoncurrentVersionTransition.NoncurrentDays | Integer | Optional | Number of days the object remains noncurrent
|
| Rule.NoncurrentVersionTransition.StorageClass | String | Optional | Storage class to be switched to
|
Request example
The request example is as follows:
Expiration request
When bucket versioning is not enabled
The example below uses the Transition rule to move objects with the "documents/" prefix to the DEEP_ARCHIVE storage class after 180 days. It uses the Expiration rule to delete objects with the "logs/" prefix 360 days after creation.
PUT /?lifecycle HTTP/1.1
Host: bucket.kr.ncloudstorage.com
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Rule>
<ID>tran_documents</ID>
<Filter>
<Prefix>documents/</Prefix>
</Filter>
<Status>Enabled</Status>
<Transition>
<Days>180</Days>
<StorageClass>DEEP_ARCHIVE</StorageClass>
</Transition>
</Rule>
</Rule>
<ID>exp_logs<ID>
<Filter>
<Prefix>logs/</Prefix>
</Filter>
<Status>Enabled</Status>
<Expiration>
<Days>360</Days>
</Expiration>
<Rule>
</LifecycleConfiguration>
When bucket versioning is enabled
The example below automatically moves all object versions with the "documents/" prefix, excluding the five most recent previous versions, to the DEEP_ARCHIVE storage class 180 days after they become non-current, in accordance with the NoncurrentVersionTransition rule. Objects with the "logs/" prefix are deleted 100 days after they become non-current, in accordance with the NoncurrentVersionExpiration rule.
PUT /?lifecycle HTTP/1.1
Host: bucket.kr.ncloudstorage.com
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Rule>
<ID>tran_noncurrent_documents</ID>
<Filter>
<Prefix>documents/</Prefix>
</Filter>
<Status>Enabled</Status>
<NoncurrentVersionTransition>
<NewerNoncurrentVersions>5</NewerNoncurrentVersions>
<NoncurrentDays>180</NoncurrentDays>
<StorageClass>DEEP_ARCHIVE</StorageClass>
</NoncurrentVersionTransition>
</Rule>
<Rule>
<ID>exp_noncurrent_logs</ID>
<Filter>
<Prefix>logs/</Prefix>
</Filter>
<Status>Enabled</Status>
<NoncurrentVersionExpiration>
<NoncurrentDays>100</NoncurrentDays>
</NoncurrentVersionExpiration>
</Rule>
</LifecycleConfiguration>
When specifying date
The following is a sample request to transition objects with the "logs/" prefix to the DEEP_ARCHIVE storage class after 2025-10-23 00:00:00 UTC, according to the Transition rule. The actual transition occurs after 00:00:00 KST on that date.
PUT /?lifecycle HTTP/1.1
Host: bucket.kr.ncloudstorage.com
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Rule>
<ID>id1</ID>
<Filter>
<Prefix>logs/</Prefix>
</Filter>
<Status>Enabled</Status>
<Transition>
<Date>2025-10-23T00:00:00.000Z</Date>
<StorageClass>DEEP_ARCHIVE</StorageClass>
</Transition>
</Rule>
</LifecycleConfiguration>
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.
Response status codes
For information about the HTTP status codes common to all Ncloud Storage APIs, see Common Ncloud Storage response status codes.
Response example
The response example is as follows:
HTTP/1.1 200 OK