Versioning
With versioning enabled, chili keeps the previous states of an object as separate versions when it is overwritten or deleted. Each version has a version ID. This lets you restore data that was overwritten or deleted by mistake. All examples use path style and the endpoint https://s3-ch-east.chilistorage.com.
You choose whether a bucket is versioned when you create it in the chili Console. Older versions take up storage; versioning is shown in the Console per TB and month. More in Versioning.
States
State | Behaviour |
|---|---|
Never enabled | Objects have the version ID |
| Every write creates a new version; deleting adds a delete marker |
| New writes get the version ID |
A bucket never returns to the "never enabled" state. You can only switch between Enabled and Suspended. On buckets with Object Lock, versioning is always enabled and cannot be suspended.
Operations
Operation | Method and path | Notes |
|---|---|---|
PutBucketVersioning |
|
|
GetBucketVersioning |
| Current state |
ListObjectVersions |
| All versions and delete markers |
GetObject / HeadObject with version |
| Read a specific version |
DeleteObject with version |
| Permanently delete a version |
Operations in detail
PutBucketVersioning
PUT /my-bucket?versioning HTTP/1.1
Host: s3-ch-east.chilistorage.com<VersioningConfiguration>
<Status>Enabled</Status>
</VersioningConfiguration>Element | Values |
|---|---|
|
|
aws s3api put-bucket-versioning --bucket my-bucket \
--versioning-configuration Status=Enabled \
--endpoint-url https://s3-ch-east.chilistorage.comGetBucketVersioning
GET /my-bucket?versioning HTTP/1.1
Host: s3-ch-east.chilistorage.com<VersioningConfiguration>
<Status>Enabled</Status>
</VersioningConfiguration>If versioning was never enabled, the Status element is missing.
aws s3api get-bucket-versioning --bucket my-bucket \
--endpoint-url https://s3-ch-east.chilistorage.comListObjectVersions
GET /my-bucket?versions&prefix=reports/ HTTP/1.1
Host: s3-ch-east.chilistorage.comLists all versions and delete markers, sorted by key and, within a key, from newest to oldest.
Parameter | Meaning |
|---|---|
| Only keys with this prefix |
| Groups keys into |
| At most this many entries, default 1000 |
| Continue the listing after this key |
| Together with |
If IsTruncated is true, fetch the next page with NextKeyMarker and NextVersionIdMarker.
<ListVersionsResult>
<Name>my-bucket</Name>
<Prefix>reports/</Prefix>
<IsTruncated>false</IsTruncated>
<DeleteMarker>
<Key>reports/2026-11.pdf</Key>
<VersionId>QUpfdndhfd8438MNFDN93jdnJFkdmqnh893</VersionId>
<IsLatest>true</IsLatest>
<LastModified>2026-11-23T08:00:00.000Z</LastModified>
</DeleteMarker>
<Version>
<Key>reports/2026-11.pdf</Key>
<VersionId>3HL4kqtJlcpXroDTDmJ.rmSpXd3dIbrHY</VersionId>
<IsLatest>false</IsLatest>
<LastModified>2026-11-22T08:00:00.000Z</LastModified>
<ETag>"9b2cf535f27731c974343645a3985328"</ETag>
<Size>482113</Size>
</Version>
</ListVersionsResult>aws s3api list-object-versions --bucket my-bucket --prefix reports/ \
--endpoint-url https://s3-ch-east.chilistorage.comReading and deleting specific versions
With the versionId parameter, GetObject, HeadObject and DeleteObject act on exactly one version:
# Download an older version
aws s3api get-object --bucket my-bucket --key reports/2026-11.pdf \
--version-id <VERSION_ID> old.pdf \
--endpoint-url https://s3-ch-east.chilistorage.com
# Permanently delete a version
aws s3api delete-object --bucket my-bucket --key reports/2026-11.pdf \
--version-id <VERSION_ID> \
--endpoint-url https://s3-ch-east.chilistorage.comA DeleteObject with versionId cannot be undone. Versions under Object Lock stay protected until their retention expires, see Object Lock (API).
Delete markers
If you delete an object in a versioned bucket without a versionId, chili removes no data. It adds a delete marker as the newest version. After that:
- GetObject without
versionIdreturns404 NoSuchKey. - The object is missing from ListObjects but appears in ListObjectVersions.
- All older versions are kept and can be read with
versionId.
If you delete the delete marker itself (DeleteObject with its versionId), the previous version becomes current again. This is how you undo an accidental delete.
aws s3api delete-object --bucket my-bucket --key reports/2026-11.pdf \
--version-id <VERSION_ID_OF_DELETE_MARKER> \
--endpoint-url https://s3-ch-east.chilistorage.comRestoring an old version
To make an older version current again, copy it onto the same key with CopyObject. chili creates a new current version with the old content. The version history is kept in full.
aws s3api copy-object --bucket my-bucket --key reports/2026-11.pdf \
--copy-source "my-bucket/reports/2026-11.pdf?versionId=<VERSION_ID>" \
--endpoint-url https://s3-ch-east.chilistorage.comOlder versions accumulate over time. A lifecycle rule with NoncurrentVersionExpiration deletes them automatically after a fixed number of days, see Lifecycle & tagging.
Next
- Versioning: feature and cost
- Objects: object operations
- Object Lock (API): locked versions
- Lifecycle & tagging: delete older versions automatically