Skip to main content

Set lifecycle rules for a bucket

PUT 

/v1/providers/:provider_id/orgs/:org_id/buckets/:bucket_name/lifecycle

Sets lifecycle rules for automatic object transitions and expiration. If lifecycle rules already exist, they will be completely replaced with the new configuration.

Lifecycle Rules Overview​

Lifecycle rules allow you to automatically:

  • Transition objects to cheaper storage classes after a specified time
  • Expire (permanently delete) objects after a specified time

Examples​

Archive old logs and delete after 1 year​

{
"rules": [
{
"id": "archive-and-cleanup-logs",
"enabled": true,
"transitions": [
{ "days": 90, "storage_class": "GLACIER" }
],
"expiration": { "days": 365 }
}
]
}

Request​

Responses​

OK