---
title: ListObjectVersions · S3 API
description: Lists the versions and delete markers in a bucket.
doc_version: 0.1.0-preview
last_updated: 2026-09-14
---

# ListObjectVersions

`GET /{bucket}?versions`

Lists the versions and delete markers in a bucket.

Returns the versions and delete markers in key order, then in version ID order. Version IDs are random, so the order within a key is not by time. Use IsLatest and LastModified to find the newest version.

- Role: Viewer or higher.
- Support: supported.
- Auth: AWS Signature Version 4 with your API key. See [S3 API](/api/s3.md).
- Lists live versions and delete markers, with key and version markers.
- Storage ignores `delimiter`. The response has no CommonPrefixes.

## Example request

```http
GET /support-tickets?versions HTTP/1.1
Host: wspq7ws2np5l8z4.storage.beta.graphon.sh
x-amz-date: 20261007T093000Z
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Authorization: AWS4-HMAC-SHA256 Credential=<ACCESS_KEY_ID>/20261007/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=<SIGNATURE>
```

## Path parameters

- `bucket` (string, required): The bucket name.

## Query parameters

- `versions` (flag, required): Selects this operation. Send it with no value.
- `prefix` (string, optional): Return only keys that start with this value.
- `key-marker` (string, optional): The NextKeyMarker of the previous page.
- `version-id-marker` (string, optional): The NextVersionIdMarker of the previous page.
- `max-keys` (integer, optional): The most keys to return. Storage clamps the value to 1 through 1,000. Default: `1000`.

## Headers

- `x-amz-expected-bucket-owner` (string, optional): The workspace ID that must own the bucket. Another owner returns `403 AccessDenied`.

## Responses

### 200 · OK

One page of versions.

Response body:

- `ListVersionsResult` (object, required): The root element.
  - `Name` (string, optional): The bucket name.
  - `Prefix` (string, optional): The prefix of the request.
  - `MaxKeys` (integer, optional): Always `1000`, whatever the request sent.
  - `IsTruncated` (boolean, optional): `true` when more versions follow.
  - `NextKeyMarker` (string, optional): Present when IsTruncated is `true`. Send it as `key-marker`.
  - `NextVersionIdMarker` (string, optional): Present when IsTruncated is `true`. Send it as `version-id-marker`.
  - `Version` (array, optional): One element for each version that holds data.
    - `Key` (string, optional): The object key.
    - `VersionId` (string, optional): The version ID.
    - `IsLatest` (boolean, optional): `true` for the current version of the key.
    - `LastModified` (string, optional): When the version was written.
    - `ETag` (string, optional): The entity tag.
    - `Size` (integer, optional): The size in bytes.
    - `StorageClass` (string, optional): The storage class that the write recorded.
  - `DeleteMarker` (array, optional): One element for each delete marker.
    - `Key` (string, optional): The object key.
    - `VersionId` (string, optional): The version ID of the marker.
    - `IsLatest` (boolean, optional): `true` when the marker is the current version.
    - `LastModified` (string, optional): When the delete happened.

```http
HTTP/1.1 200 OK
Content-Type: application/xml
x-amz-request-id: 4F8A2C7D1E6B4093A5C2D8E1F7B3A960

<?xml version="1.0" encoding="UTF-8"?>
<ListVersionsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
  <Name>support-tickets</Name>
  <Prefix></Prefix>
  <MaxKeys>1000</MaxKeys>
  <IsTruncated>false</IsTruncated>
  <DeleteMarker>
    <Key>a.json</Key>
    <VersionId>ver_1a2b3c4d5e6f47a8b9c0d1e2f3a4b5c6</VersionId>
    <IsLatest>true</IsLatest>
    <LastModified>2026-10-07T10:05:00.000Z</LastModified>
  </DeleteMarker>
  <Version>
    <Key>a.json</Key>
    <VersionId>ver_5f0c8a8e3d2b4c1e9a7f6b5d4c3b2a19</VersionId>
    <IsLatest>false</IsLatest>
    <LastModified>2026-10-07T09:30:00.000Z</LastModified>
    <ETag>"9b2cf535f27731c974343645a3985328"</ETag>
    <Size>34</Size>
    <StorageClass>STANDARD</StorageClass>
  </Version>
</ListVersionsResult>
```

## Errors

Any request can also get the common errors on [S3 API](/api/s3.md).

### 404 · `NoSuchBucket`

No bucket has this name, or the bucket was deleted.

Check the bucket name. ListBuckets shows the buckets of the workspace.

### 403 · `AccessDenied`

The key does not have the role for this operation, or the bucket is in another workspace.

Use a key of the workspace that owns the bucket, with the role above.

## Other request languages

### aws CLI

```bash
# The graphon profile from the S3 API overview.
export AWS_PROFILE=graphon

aws s3api list-object-versions --bucket support-tickets
```

### Python (boto3)

```python
# Replace wspq7ws2np5l8z4 with your workspace ID.
import os

import boto3
from botocore.config import Config

api_key = os.environ["GRAPHON_API_KEY"]
access_key_id = api_key.split("_", 1)[1].split(".")[0]

s3 = boto3.client(
    "s3",
    endpoint_url="https://wspq7ws2np5l8z4.storage.beta.graphon.sh",
    region_name="us-east-1",
    aws_access_key_id=access_key_id,
    aws_secret_access_key=api_key,
    config=Config(signature_version="s3v4", s3={"addressing_style": "path"}),
)

response = s3.list_object_versions(
    Bucket="support-tickets",
)
for version in response.get("Versions", []):
    print(version["Key"], version["VersionId"])
```

### JavaScript (AWS SDK)

```javascript
// Replace wspq7ws2np5l8z4 with your workspace ID.
import { S3Client, ListObjectVersionsCommand } from '@aws-sdk/client-s3';

const apiKey = process.env.GRAPHON_API_KEY;
if (!apiKey) throw new Error('Set GRAPHON_API_KEY.');
const accessKeyId = apiKey.split('_')[1].split('.')[0];

const s3 = new S3Client({
  endpoint: 'https://wspq7ws2np5l8z4.storage.beta.graphon.sh',
  region: 'us-east-1',
  forcePathStyle: true,
  credentials: { accessKeyId, secretAccessKey: apiKey },
});

const response = await s3.send(new ListObjectVersionsCommand({
  Bucket: 'support-tickets',
}));
console.log(response.Versions, response.DeleteMarkers);
```

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
