Skip to main content

Bucket

You can use the Object Storage bucket API to manage bucket creation, properties, and policies.

Prerequisite

  • For prerequisites to call the API, refer to Prepare to use api.
  • For a description of the Object Storage API model, refer to API model.

API endpoint URL

The Object Storage API endpoint URL for the kr-central-2 region is:

Object Storage API endpoint URL format
https://objectstorage.kr-central-2.kakaocloud.com

Create bucket

Creates a bucket.

Permission

According to IAM roles, the project admin or project member role is required to create a bucket.

Request syntax
Create bucket request syntax
curl --request PUT --location 'https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket' \
--header 'X-Auth-Token: {x-auth-token}' \
--header 'Content-Type: application/json' \
--data '{
"name": "my-bucket-new",
"type": "STANDARD",
"use_encryption": true,
"encryption_configuration": {
"type": "managed"
}
}'
API call method
MethodRequest URL
PUThttps://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket
Request headers
HeaderTypeRequiredDescription
X-Auth-TokenStringYesEnter the authentication token
Content-TypeStringYesMust be application/json
Request body
FieldTypeRequiredDescription
nameStringYesBucket name
typeStringYesBucket type
- Standard (default): standard bucket
use_encryptionBooleanNoWhether to enable bucket encryption
Ignored if encryption_configuration is provided
- false (default): do not encrypt
- true: encrypt (same as encryption_configuration.type = managed)
encryption_configurationObjectNoEncryption settings for the bucket
└─ typeStringYesEncryption method
- managed (default): server-managed encryption
- true (planned): KMS-managed encryption (future support)
Response syntax
Create bucket response syntax
{
"account": "project-id",
"project": "project-id",
"name": "my-bucket-new",
"type": "STANDARD",
"bytes": 0,
"objectCount": 0,
"createdAt": "2022-04-25T10:28:57Z",
"acl": {
"permissions": null,
"public": "read-only",
"public_read_allow_ip_list": [
"ip / cidr"
]
},
"lastModified": "2022-04-25T10:28:57Z",
"use_encryption": true,
"encryption_type": "managed",
"storageClass": "STANDARD",
"storagePolicy": "default-placement"
}
Response elements
FieldTypeDescription
account (Deprecated)StringProject ID (Account ID used in Swift API)
projectStringProject ID
nameStringBucket name
typeStringBucket type
- STANDARD (default): standard bucket
bytesStringTotal usage in bytes
objectCountIntegerNumber of objects in the bucket
createdAtStringCreation time (RFC3339 format)
use_encryptionBooleanWhether encryption is enabled
encryption_typeStringEncryption type
lastModifiedStringLast modified time (RFC3339 format)
storageClassStringStorage class type
- STANDARD (default): standard
storagePolicyStringStorage policy zone
- default-placement (default)
aclObjectBucket access permissions
└─ publicStringPublic access level
- read-only, deny
└─ public_read_allow_ip_listListList of allowed IPs for public access
HTTP status codes
HTTP statusMeaningDescription
200OKSuccess
400Bad requestInput error
401UnauthorizedNo permission
409ConflictBucket name already exists

Manage bucket

View bucket details

If you have the storage.buckets.get permission, you can retrieve detailed information about a specific bucket.
For more details on Object Storage permissions, refer to Role and permission.

Request syntax
View bucket details request syntax
curl --location --request GET 'https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}' \
--header 'X-Auth-Token: {x-auth-token}'
API call method
MethodRequest URL
GEThttps://objectstorage.{region_name}.kakaocloud.com/v1_ext/{bucket_name}
PathTypeRequiredDescription
region_nameStringYesRegion name
- kr-central-2
bucket_nameStringYesBucket name
Request header
HeaderTypeRequiredDescription
X-Auth-TokenStringYesUser authentication token
Response syntax

For detailed information about the bucket API model, refer to Bucket API model.

View bucket details response syntax
{    
"project": "project-id",
"name": "test-bucket-01",
"type": "STANDARD",
"bytes": 0,
"objectCount": 0,
"createdAt": "2023-06-21T07:17:10Z",
"use_encryption": true,
"encryption_type": " ",
"lastModified": "2023-06-21T07:17:10Z",
"storageClass": "STANDARD",
"storagePolicy": "default-placement",
"acl": {
"public": "deny",
"public_read_allow_ip_list": null
}
}
Response elements
FieldTypeDescription
projectStringProject ID
- Visible when issuing a token
- Used in S3 API
nameStringName of the created bucket
typeStringBucket type
- standard (default): standard bucket
bytesStringTotal usage (unit: byte)
objectCountIntNumber of objects in the bucket
createdAtStringCreation time
- Format: RFC3339
use_encryptionBooleanWhether bucket encryption is enabled
encryption_typeStringEncryption type
lastModifiedStringLast modified time
- Format: RFC3339
storageClassStringStorage class type (available only in kr-central-2)
- standard (default)
storagePolicyStringStorage policy zone
aclObjectAccess control settings
└─ publicStringPublic read access level
- read-only or deny
└─ public_read_allow_ip_listListList of IPs allowed for public access
HTTP status codes
HTTP statusMeaningDescription
200OKSuccess
400Bad requestInvalid input
401UnauthorizedAuthentication failed
403ForbiddenNo permission

Query bucket list

You can query the list of buckets.

Permission

According to IAM roles, project admin or project member roles are required to query buckets.

Request syntax
Query bucket list request syntax
curl --location --request GET 'https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket?limit=100' \
--header 'X-Auth-Token: {x-auth-token}'
API call method
MethodRequest URL
GEThttps://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket
Request path
ParameterTypeRequiredDescription
region_nameStringYesRegion name
- kr-central-2
Request header
HeaderTypeRequiredDescription
X-Auth-TokenStringYesUser authentication token
Request query
ParameterTypeRequiredDescription
offsetQueryNoStarting point of the result list (default: 0)
limitQueryNoMaximum number of items to return (default: 20, up to 100)
prefixQueryNoFilter bucket names by prefix
includeQueryNoSearch buckets by inclusion string
- Cannot be used with prefix
typeQueryNoBucket type
- STANDARD
byQueryNoSorting field
- bucket_name, bucket_type, created_at, bytes_used
directQueryNoSort order
- asc (default), desc
Response syntax
Query bucket list response syntax
{
"totalCount": 12,
"offset": 0,
"count": 10,
"items": [SimpleBucket]
}
Response elements
FieldTypeDescription
totalCountIntTotal number of buckets
offsetIntOffset for pagination
countIntNumber of returned buckets
itemsListList of bucket details
- See Model - Simple bucket
HTTP status codes
HTTP statusMeaningDescription
200OKSuccess
401UnauthorizedInvalid token
403ForbiddenNo permission

Manage bucket access

You can manage access to your owned buckets.
Using the following request, you can configure public access and apply IP-based access control to your bucket.

Request syntax
Access control by IP list request syntax
curl --request POST --location 'https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}' \
--header 'X-Auth-Token: {x-auth-token}' \
--header 'Content-Type: application/json' \
--data '{
"name": "my-bucket-new",
"acl": {
"public": "read-only",
"public_read_allow_ip_list": [
"1.1.1.1",
"2.2.2.0/24"
]
}
}'
API call method
MethodRequest URL
POSThttps://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}
PathTypeRequiredDescription
bucket_nameStringYesBucket name
Request header
HeaderTypeRequiredDescription
X-Auth-TokenStringYesUser authentication token
Content-TypeStringYesFixed to application/json
Request body
FieldTypeRequiredDescription
bucket_nameStringYesBucket name
aclObjectYesAccess control list settings
- Use null to delete existing ACL
└ publicStringOptionalPublic access setting
- read-only, deny (same as null)
└ public_read_allow_ip_listListOptionalList of IP addresses allowed for public read access
Response syntax
Manage bucket access response syntax
{
"project": "0bc7a4c4a8fb4fee98dcf1936d8ed8eb",
"account": "0bc7a4c4a8fb4fee98dcf1936d8ed8eb",
"name": "my-bucket-new",
"type": "STANDARD",
"bytes": 0,
"objectCount": 0,
"createdAt": "2023-07-08T04:08:05Z",
"use_encryption": true,
"encryption_type": "managed",
"lastModified": "2023-07-08T04:08:05Z",
"storageClass": "STANDARD",
"storagePolicy": "default-placement",
"acl": {
"public": "deny",
"public_read_allow_ip_list": null
}
}
Response elements
FieldTypeDescription
account (deprecated)StringProject ID (deprecated)
projectStringProject ID
nameStringBucket name
typeStringBucket type
- STANDARD (default)
bytesStringTotal usage in bytes
objectCountIntNumber of objects in the bucket
createdAtStringCreation time (RFC3339)
use_encryptionBooleanEncryption enabled or not
encryption_typeStringType of encryption
lastModifiedStringLast modified time (RFC3339)
storageClassStringStorage class
- STANDARD (default)
storagePolicyStringStorage zone
- default-placement
aclObjectAccess control settings
└ publicStringread-only, deny
└ public_read_allow_ip_listListList of allowed IPs for public access
HTTP status codes
HTTP statusMeaningDescription
200OKSuccess
401UnauthorizedInvalid or expired token
403ForbiddenInsufficient permissions
404Not foundBucket not found

Delete bucket

You can delete a bucket you own.
To delete a bucket, the storage.buckets.delete permission is required.

  • You cannot delete a bucket that contains objects.
Request syntax
Delete bucket request syntax
curl --location --request DELETE 'https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}' \
--header 'X-Auth-Token: {x-auth-token}'
API call method
MethodRequest URL
DELETEhttps://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}
Request path
FieldTypeRequiredDescription
region_nameStringYesRegion name
- kr-central-2
bucket_nameStringYesName of the bucket to delete
Request header
HeaderTypeRequiredDescription
X-Auth-TokenStringYesUser authentication token
HTTP status codes
HTTP statusMeaningDescription
204No contentSuccessfully deleted
401UnauthorizedAuthentication failed
404Not foundBucket not found
409ConflictBucket is not empty

Bulk delete buckets and objects

Users with delete permissions can delete buckets and objects in bulk within a project.
The input list will be processed sequentially, and the result of each deletion will be returned as a single response body.

  • Feature coming soon.

Empty bucket

If you have storage.objects.delete permission, you can delete all objects under a bucket.
For more details, refer to roles and permissions.

Request syntax
Empty bucket request syntax
curl --location --request DELETE 'https://objectstorage.{region_name}.kakaocloud.com/v1/{account}/{bucket_name}/?dir-delete' \
--header 'X-Auth-Token: {X-Auth-Token}'
API call method
MethodRequest URL
DELETEhttps://objectstorage.{region_name}.kakaocloud.com/v1/{account}/{bucket_name}/?dir-delete
PathTypeRequiredDescription
accountStringYesProject ID
- Used as account in Swift API
directoryStringOptionalDirectory to delete under the bucket
Request header
HeaderTypeRequiredDescription
X-Auth-TokenStringYesUser authentication token
HTTP status codes
HTTP statusDescription
200Success
400Bad request (invalid name or not found)
401Unauthorized
403Forbidden

Empty bucket folder

If you have storage.objects.delete permission, you can delete all objects under a specific path (folder) in a bucket.
For more details, refer to roles and permissions.

Request syntax
Empty bucket folder request syntax
curl --location --request DELETE 'https://objectstorage.{region_name}.kakaocloud.com/v1/{account}/{bucket_name}/{directory}/?dir-delete' \
--header 'X-Auth-Token: {X-Auth-Token}'
API call method
MethodRequest URL
DELETEhttps://objectstorage.{region_name}.kakaocloud.com/v1/{account}/{bucket_name}/{directory}/?dir-delete
PathTypeRequiredDescription
accountStringYesProject ID
bucket_nameStringYesBucket name
directoryStringOptionalDirectory name to delete under the bucket
Request header
HeaderTypeRequiredDescription
X-Auth-TokenStringYesUser authentication token
HTTP status codes
HTTP statusDescription
200Success
400Bad request (invalid name or not found)
401Unauthorized
403Forbidden

Query bucket metadata

If you have storage.buckets.get permission, you can query the metadata of a bucket.
Refer to roles and permissions for more details.

You can retrieve bucket metadata using either the GET or HEAD method.

Request syntax
Query bucket metadata (GET)
curl --location --request GET 'https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}' \
--header 'X-Auth-Token: {x-auth-token}'
API call method
MethodRequest URL
GEThttps://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}
PathTypeRequiredDescription
bucket_nameStringYesBucket name
Request header
HeaderTypeRequiredDescription
X-Auth-TokenStringYesUser authentication token
Response header
HeaderTypeDescription
X-Container-Meta-*StringUser-defined metadata
Response elements
FieldTypeDescription
projectStringProject ID
nameStringBucket name
typeStringBucket type (e.g., STANDARD)
bytesIntTotal used capacity (updated every 30 minutes)
objectCountIntNumber of objects (updated every 30 minutes)
createdAtTimeBucket creation time
use_encryptionBooleanWhether encryption is enabled
lastModifiedTimeLast modified timestamp
storageClassStringStorage class (e.g., STANDARD)
acl ▼ListAccess control settings
    publicStringPublic access setting (read-only, deny)
    public_read_allow_ip_listStringAllowed IP list for public access
HTTP status codes
HTTP statusDescription
200Success
401Unauthorized
403Forbidden
404Not found

Change bucket metadata

If you have the storage.buckets.update permission, you can modify metadata for a bucket you have access to.
Refer to roles and permissions for more details on Object Storage permissions.

Request syntax
Change bucket metadata request syntax
curl --location --request POST 'https://objectstorage.{region_name}.kakaocloud.com/v1/{account}/{bucket_name}' \
--header 'X-Auth-Token: {x-auth-token}' \
--header 'X-Object-Meta-Company: kakao enterprise'
API call method
MethodRequest URL
POSThttps://objectstorage.{region_name}.kakaocloud.com/v1/{account}/{bucket_name}
Request parameters
PathTypeRequiredDescription
region_nameStringYesRegion name (e.g., kr-central-2)
accountStringYesProject ID (used as account in Swift API)
bucket_nameStringYesBucket name
Request headers
HeaderTypeRequiredDescription
X-Auth-TokenStringYesUser authentication token
X-Object-Meta-{name}StringYesCustom metadata key/value to be set for the bucket
HTTP status codes
HTTP statusDescription
200Success
401Unauthorized

Bucket CORS policy

Configure new CORS policy

Users with the storage.buckets.setIamPolicy permission can set CORS policies for individual buckets.
For more details, refer to roles and permissions.

  • If "cors": [] or an empty body is passed, all existing CORS configurations will be removed and the default CORS policy will be applied.
  • This setting only affects the following APIs:
    • /v1/:account/:container
    • /v1/:account/:container/*object
    • /:bucket (kr-central-2 S3 API)
    • /:bucket/*object (kr-central-2 S3 API)
info

If no CORS policy is set, access from external domains (non-console) will be denied.

Request syntax
CORS policy configuration request syntax
curl --request PUT --location 'https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}/cors' \
--header 'X-Auth-Token: {x-auth-token}' \
--header 'Content-Type: application/json' \
--data '{
"cors": [
{
"allowed_origins": [
"https://www.example1.com"
],
"allowed_methods": [
"PUT",
"GET"
],
"allowed_headers": [
"*"
],
"expose_headers": [],
"max_age_seconds": 10
},
{
"allowed_origins": [
"https://www.example2.com"
],
"allowed_methods": [
"PUT",
"GET",
"DELETE"
],
"allowed_headers": [
"*"
],
"expose_headers": [
"X-Object-Meta-User-Defined"
],
"max_age_seconds": 10
}
]
}'
API call method
MethodRequest URL
PUThttps://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}/cors
Request parameters
PathTypeRequiredDescription
region_nameStringYesRegion name (e.g., kr-central-2)
bucket_nameStringYesBucket name
Request headers
HeaderTypeRequiredDescription
X-Auth-TokenStringYesUser authentication token
Content-TypeStringYesMust be application/json
Request body elements
FieldTypeRequiredDescription
cors ▼ListYesCORS policy array (maximum of 10 entries)
    allowed_originsListYesList of allowed origins (e.g., "https://example.com")
    allowed_methodsListYesHTTP methods allowed (e.g., GET, PUT, DELETE)
    allowed_headersListYesList of allowed headers
    expose_headersListYesHeaders exposed to browsers
    max_age_secondsIntNoDuration to cache preflight request results
Response syntax
CORS policy configuration response syntax
{
"cors": [
{
"allowed_origins": [
"https://www.example1.com"
],
"allowed_headers": [
"*"
],
"allowed_methods": [
"PUT",
"GET"
],
"expose_headers": [],
"max_age_seconds": 10
},
{
"allowed_origins": [
"https://www.example2.com"
],
"allowed_headers": [
"*"
],
"allowed_methods": [
"PUT",
"GET",
"DELETE"
],
"expose_headers": [
"X-Object-Meta-User-Defined"
],
"max_age_seconds": 10
}
]
}
HTTP status codes
HTTP statusDescription
200OK (Success)
400Bad request
401Unauthorized
403Forbidden
404Bucket not found

Query bucket CORS policy

If you have the storage.buckets.getIamPolicy permission, you can query the CORS configuration for an individual bucket.
Refer to roles and permissions for more information on Object Storage access control.

Request syntax
CORS policy query request syntax
curl --request GET --location 'https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}/cors' \
--header 'X-Auth-Token: {x-auth-token}' \
--header 'Content-Type: application/json'
API call method
MethodRequest URL
GEThttps://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}/cors
Request parameters
PathTypeRequiredDescription
region_nameStringYesRegion name (e.g., kr-central-2)
bucket_nameStringYesBucket name
Request headers
HeaderTypeRequiredDescription
X-Auth-TokenStringYesUser authentication token
Content-TypeStringYesMust be application/json
Response syntax
CORS policy query response syntax
{
"cors": [
{
"allowed_origins": ["https://www.example1.com"],
"allowed_headers": ["*"],
"allowed_methods": ["PUT", "GET"],
"expose_headers": [],
"max_age_seconds": 10
},
{
"allowed_origins": ["https://www.example2.com"],
"allowed_headers": ["*"],
"allowed_methods": ["PUT", "GET", "DELETE"],
"expose_headers": ["X-Object-Meta-User-Defined"],
"max_age_seconds": 10
}
]
}
Response elements
FieldTypeRequiredDescription
cors ▼ListYesCORS policies (up to 10 entries)
    allowed_originsListYesList of allowed origins (supports one *, max length: 200 per origin)
    allowed_methodsListYesAllowed HTTP methods
    allowed_headersListYesAllowed HTTP headers
    expose_headersListYesHeaders exposed to browsers
    max_age_secondsIntNoPreflight request result cache duration
HTTP status codes
HTTP statusDescription
200OK (Success)
400Bad request
401Unauthorized (auth failed)
403Forbidden (no permission)

CORS preflight request

You can send a CORS preflight request to a bucket.

  • If a CORS configuration was applied via PUT /v1_ext/bucket/:name/cors, the APIs listed below will respond accordingly:
    • /v1/:account/:container
    • /v1/:account/:container/*object
    • /:bucket (kr-central-2 S3 API)
    • /:bucket/*object (kr-central-2 S3 API)
Request syntax
CORS preflight request syntax
curl --location --request OPTIONS 'http://objectstorage.{region_name}.kakaocloud.com/v1/{account}/{bucket_name}/test.txt' \
--header 'Origin: https://www.example1.com' \
--header 'Access-Control-Request-Headers: X-Auth-Token,Content-Type' \
--header 'Access-Control-Request-Method: GET'
Request parameters
PathTypeRequiredDescription
accountStringYesProject ID (used as account in Swift API)
bucket_nameStringYesBucket name
Request headers
HeaderTypeRequiredDescription
OriginStringYesFull origin (protocol + host + port)
Access-Control-Request-HeadersListYesRequested headers (e.g., X-Auth-Token, Content-Type)
Access-Control-Request-MethodListYesRequested methods (e.g., PUT, GET, DELETE)
API call method
MethodRequest URL
OPTIONSMultiple variations depending on the object path and region, such as:
- /v1/:account/:name
- /v1/:account/:name/*object
- /v1_ext/bucket/:name
- /v1_ext/bucket/:name/policy/:id
Response headers
HeaderTypeDescription
Content-LengthIntBody size
Access-Control-Allow-CredentialsBooleanWhether to allow credentials (true or false)
Access-Control-Allow-HeadersStringAllowed HTTP headers
Access-Control-Allow-MethodsStringAllowed HTTP methods
Access-Control-Allow-OriginStringAllowed origin
Access-Control-Expose-HeadersStringHeaders exposed to browser
Access-Control-Max-AgeIntCache duration for preflight request results
Response syntax
CORS preflight request response syntax
HTTP/1.1 200 OK
Content-Length: 0
Connection: keep-alive
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: *
Access-Control-Allow-Methods: PUT, GET
Access-Control-Allow-Origin: https://www.example1.com
Access-Control-Expose-Headers:
Access-Control-Max-Age: 10
Vary: Origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
HTTP status codes
HTTP statusDescription
200OK (Success)
401Unauthorized (auth failed)
403Forbidden (no permission)

Requests other than CORS preflight

CORS validation is performed based on the request. If the request does not comply with the configured CORS policy, headers such as Access-Control-Allow-Header, Access-Control-Allow-Methods, and Access-Control-Max-Age will not be included in the response.
To apply CORS, the Origin header must be set in the request.

Request syntax
Request syntax for non-preflight CORS
curl --location --request GET 'http://objectstorage.{region_name}.kakaocloud.com/v1/{account}/{bucket_name}/{object}' \
--header 'x-auth-token: {x-auth-token}' \
--header 'Origin: https://www.example1.com'
API call method
MethodRequest URL
GEThttp://objectstorage.{region_name}.kakaocloud.com/v1/{account}/{bucket_name}/{object}
Request parameters
PathTypeRequiredDescription
region_nameStringYesRegion name (e.g., kr-central-2)
accountStringYesProject ID (used in Swift API as the account value)
bucket_nameStringYesBucket name
objectStringYesObject name
Request headers
HeaderTypeRequiredDescription
X-Auth-TokenStringYesUser authentication token
Response syntax
Response header for non-preflight CORS
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 10
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: https://www.example1.com
Access-Control-Allow-Methods: PUT, GET
Access-Control-Expose-Headers: {}
Etag: {ETag value}
Last-Modified: Thu, 07 Jul 2022 08:13:27 GMT
Vary: Origin
Response elements
HeaderDescription
Content-TypeIndicates the media type of the resource
Content-LengthSize of the response body in bytes
Access-Control-Allow-CredentialsAllows credential sharing between domains
- true: allowed
- false: not allowed
Access-Control-Allow-OriginAllowed origin
Access-Control-Expose-HeadersHeaders exposed to the browser
EtagUnique hash value for the object
- Helps optimize caching and detect mid-air collisions
Last-ModifiedLast modified time of the object
HTTP status codes
HTTP statusDescription
200OK (success)
401Unauthorized
403Forbidden

Bucket lifecycle

To create and manage a bucket lifecycle, the storage.buckets.update permission is required.
For more information about Object Storage permissions, refer to Roles and permissions.

Create bucket lifecycle

When a new lifecycle configuration is created, any existing configuration will be overwritten.
Therefore, if only a portion of an existing lifecycle needs to be updated, the full configuration must be retrieved, modified, and resubmitted.

Request syntax
Create bucket lifecycle request syntax
PUT /v1_ext/bucket/{bucket_name}/lifecycle
X-Auth-Token: {x-auth-token}

<?xml version="1.0"?>
<LifecycleConfiguration>
<Rule>
<ID>day1Rule</ID>
<Expiration>
<Days>1</Days>
</Expiration>
<Prefix>expire1/</Prefix>
<Status>Enabled</Status>
</Rule>
<Rule>
<ID>dateRule</ID>
<Expiration>
<Date>2023-06-10T00:00:00.000Z</Date>
</Expiration>
<Prefix>20230-06-08/</Prefix>
<Status>Enabled</Status>
</Rule>
</LifecycleConfiguration>
API call method
MethodRequest URL
PUThttps://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}/lifecycle
Request header
HeaderTypeRequiredDescription
X-Auth-TokenStringYesUser authentication token
Request body
ElementTypeRequiredDescription
Rule ▼ListYesList of lifecycle policies
IDStringOptionalUnique identifier for the rule (max 255 characters)
Expiration ▼StructYesExpiration configuration (must include either Date or Days)
DateTimestampOptionalExpiration date in ISO 8601 format
DaysIntegerOptionalNumber of days after object creation until expiration (positive integer)
Filter ▼StructOptionalFiltering conditions for the rule
PrefixStringYesPrefix to apply the rule to
Special characters must be escaped using XML entities
StatusStringYesEnable or disable the rule (Enabled, Disabled)
Response syntax
Create bucket lifecycle response syntax
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
Date: Wed, 01 Feb 2023 07:23:12 GMT
Content-Length: 376

<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration>
<Rule>
<ID>day1Rule</ID>
<Expiration>
<Days>1</Days>
</Expiration>
<Prefix>expire1/</Prefix>
<Status>Enabled</Status>
</Rule>
<Rule>
<ID>dateRule</ID>
<Expiration>
<Date>2023-06-10T00:00:00.000Z</Date>
</Expiration>
<Prefix>20230-06-08/</Prefix>
<Status>Enabled</Status>
</Rule>
</LifecycleConfiguration>
HTTP status codes
HTTP statusDescription
200OK (success)
400Bad request (invalid configuration)
401Unauthorized
403Forbidden
404Not found (bucket not found)

View bucket lifecycle list

If you have storage.buckets.update permission, you can manage the lifecycle configuration for a bucket to automate object expiration and optimize storage space.

info

The expiration rule runs once daily at midnight (00:00).
If the policy is deleted before midnight on the expiration date, it will not be applied.

Request syntax
View bucket lifecycle list request syntax
curl --location --request GET 'https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}/lifecycle' \
--header 'X-Auth-Token: {X-Auth-Token}'
API call method
MethodRequest URL
GEThttps://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}/lifecycle
Request header
HeaderTypeRequiredDescription
X-Auth-TokenStringYesUser authentication token
Response syntax
View bucket lifecycle list response syntax
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
Date: Wed, 01 Feb 2023 07:23:12 GMT
Content-Length: 376

<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration>
<Rule>
<ID>day1Rule</ID>
<Expiration>
<Days>1</Days>
</Expiration>
<Prefix>expire1/</Prefix>
<Status>Enabled</Status>
</Rule>
<Rule>
<ID>dateRule</ID>
<Expiration>
<Date>2023-06-10T00:00:00.000Z</Date>
</Expiration>
<Prefix>20230-06-08/</Prefix>
<Status>Enabled</Status>
</Rule>
</LifecycleConfiguration>
HTTP status codes
HTTP statusDescription
200OK (success)
400Bad request (invalid configuration)
401Unauthorized
403Forbidden
404Not found (bucket not found)

Delete bucket lifecycle

A user with lifecycle access can delete a bucket’s lifecycle configuration.

Request syntax
Delete bucket lifecycle request syntax
curl --location --request DELETE 'https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}/lifecycle' \
--header 'X-Auth-Token: {X-Auth-Token}'
API call method
MethodRequest URL
DELETEhttps://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}/lifecycle
Request header
HeaderTypeRequiredDescription
X-Auth-TokenStringYesUser authentication token
HTTP status codes
HTTP statusDescription
200OK (success)
400Bad request (invalid configuration)
401Unauthorized
403Forbidden
404Not found (bucket not found)