Docs

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 null; overwriting replaces the object

Enabled

Every write creates a new version; deleting adds a delete marker

Suspended

New writes get the version ID null; existing versions are kept

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

PUT /{bucket}?versioning

Enabled or Suspended

GetBucketVersioning

GET /{bucket}?versioning

Current state

ListObjectVersions

GET /{bucket}?versions

All versions and delete markers

GetObject / HeadObject with version

GET /{bucket}/{key}?versionId={id}

Read a specific version

DeleteObject with version

DELETE /{bucket}/{key}?versionId={id}

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

Status

Enabled turns versioning on, Suspended pauses it

aws s3api put-bucket-versioning --bucket my-bucket \
  --versioning-configuration Status=Enabled \
  --endpoint-url https://s3-ch-east.chilistorage.com

GetBucketVersioning

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.com

ListObjectVersions

GET /my-bucket?versions&prefix=reports/ HTTP/1.1
Host: s3-ch-east.chilistorage.com

Lists all versions and delete markers, sorted by key and, within a key, from newest to oldest.

Parameter

Meaning

prefix

Only keys with this prefix

delimiter

Groups keys into CommonPrefixes

max-keys

At most this many entries, default 1000

key-marker

Continue the listing after this key

version-id-marker

Together with key-marker: continue after this version

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.com

Reading 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.com

A 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 versionId returns 404 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.com

Restoring 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.com

Older versions accumulate over time. A lifecycle rule with NoncurrentVersionExpiration deletes them automatically after a fixed number of days, see Lifecycle & tagging.

Next