---
title: "Lifecycle Policy With the Wasabi S3 API"
slug: "lifecycle-policy"
updated: 2025-08-14T18:02:00Z
published: 2025-08-14T18:02:00Z
canonical: "docs.wasabi.com/lifecycle-policy"
---
> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wasabi.com/llms.txt
> Use this file to discover all available pages before exploring further.
# Lifecycle Policy With the Wasabi S3 API
The Lifecyle feature establishes a Lifecycle policy with rules to define actions that you want Wasabi to take during the life of an object. This feature replaces the need to manually delete an object after a retention period.
### Configuring Lifecycle Settings
The lifecycle settings for a bucket are configured with the "put-bucket-lifecycle-configuration" command. For example:
```json
$ aws s3api put-bucket-lifecycle-configuration --bucket 1-1-1-1 --endpoint-url https://s3.wasabisys.com --lifecycle-configuration file://lifecycle.json{
"Rules": [
{
"Expiration": {
"Days": 1
},
"ID": "lifecycle_rule_1",
"Filter": {
"And": {
"ObjectSizeGreaterThan": 1,
"ObjectSizeLessThan": 21474836480
}
},
"Status": "Enabled"
},
{
"Expiration": {
"Days": 1
},
"ID": "object_lifecycle_rule_bucket_6807766",
"Filter": {
"Prefix": "1"
},
"Status": "Enabled"
}
]}
```
Here is another example:
```json
PUT https://s3.wasabisys.com/1-1-1-1?lifecycle
1
lifecycle_rule_1
1
21474836480
Enabled
1
object_lifecycle_rule_bucket_6807766
1
Enabled
```
There is no response body for this call.
### Retrieving Lifecycle Settings
The lifecycle settings for a bucket can be retrieved with the "get-bucket-lifecycle-configuration" command. For example:
```json
$ aws s3api get-bucket-lifecycle-configuration --bucket 1-1-1-1 --endpoint-url https://s3.wasabisys.com{
"Rules": [
{
"Expiration": {
"Days": 1
},
"ID": "lifecycle_rule_1",
"Filter": {
"And": {
"ObjectSizeGreaterThan": 1,
"ObjectSizeLessThan": 21474836480
}
},
"Status": "Enabled"
},
{
"Expiration": {
"Days": 1
},
"ID": "object_lifecycle_rule_bucket_6807766",
"Filter": {
"Prefix": "1"
},
"Status": "Enabled"
}
]}
```
Here is another example:
```json
GET https://s3.wasabisys.com/1-1-1-1?lifecycle
1
lifecycle_rule_1
1
21474836480
Enabled
1
object_lifecycle_rule_bucket_6807766
1
Enabled
```
### Deleting Lifecycle Settings
The lifecycle settings for a bucket can be deleted with the "delete-bucket-lifecycle" command. For example:
```json
$ aws s3api delete-bucket-lifecycle --bucket 1-1-1-1 --endpoint-url https://s3.wasabisys.com
```
Here is another example:
```json
DELETE http://wasabisys.com/1-1-1-1?lifecycle
```
There is no response body for this call.