Canonical: https://weaveos.com/reference/amazon-s3/list-object-versions

1. [Software capabilities](https://weaveos.com/reference)
2. /[Amazon S3](https://weaveos.com/reference/amazon-s3)
3. /List Amazon S3 object versions and delete markers

[![](https://weaveos.com/reference/logos/amazon-s3.svg)Amazon S3](https://weaveos.com/reference/amazon-s3)

# List Amazon S3 object versions and delete markers

Use ListObjectVersions when a bucket has versioning and an operator needs historical object versions or delete markers. Follow both key and version markers when the response is truncated.

Documentation reviewed November 27, 2026 · 2 methods with sources

## Ways to do it

1. [1API: GET ?versions](https://weaveos.com/reference/amazon-s3/list-object-versions#method-1)
2. [2CLI: aws s3api list-object-versions](https://weaveos.com/reference/amazon-s3/list-object-versions#method-2)

API

### GET ?versions

List versions and delete markers in a general purpose bucket. Use prefix to narrow the response.

[Read source: Amazon S3 ListObjectVersions API](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectVersions.html)

- Requirements

  A Signature Version 4 signed request, s3:ListBucketVersions on the bucket, and a regional bucket endpoint.

- Limitations

  When IsTruncated is true, pass NextKeyMarker and NextVersionIdMarker as key-marker and version-id-marker. Directory buckets do not support this operation.

Example text

Copy

```
GET /?versions&prefix=backups%2F&max-keys=100
```

CLI

### aws s3api list-object-versions

Inspect version IDs, IsLatest flags, and delete markers from the AWS CLI.

[Read source: AWS CLI list-object-versions reference](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-object-versions.html)

- Requirements

  AWS CLI configured for the target account and region, s3:ListBucketVersions, and a bucket name.

- Limitations

  The CLI returns a NextToken when its --max-items cap truncates output. Pass it to --starting-token for the next invocation.

Example shell

Copy

```
aws s3api list-object-versions --bucket "$S3_BUCKET" --prefix backups/ --max-items 100 --output json
```

[Previous Amazon S3 taskList Amazon S3 objects by prefix](https://weaveos.com/reference/amazon-s3/list-objects-by-prefix)

## More from Amazon S3

[View all 2 Amazon S3 tasks](https://weaveos.com/reference/amazon-s3)

## The same task in other apps

- [![](https://weaveos.com/reference/logos/aws-lambda.svg)AWS Lambda](https://weaveos.com/reference/aws-lambda)

  ### [List versions of an AWS Lambda function](https://weaveos.com/reference/aws-lambda/list-function-versions)

  Use the AWS CLI to inspect the versions of a function from your terminal. The Go SDK’s paginator lets a script process each page of version configurations.

  CLI, SDK

- [![](https://weaveos.com/reference/logos/google-cloud-storage.svg)Google Cloud Storage](https://weaveos.com/reference/google-cloud-storage)

  ### [List object generations in Google Cloud Storage](https://weaveos.com/reference/google-cloud-storage/list-object-generations)

  Use the JSON API or gcloud storage ls to inspect object versions and generations in a bucket. Keep the version flag explicit when reconciling historical objects.

  API, CLI

- [![](https://weaveos.com/reference/logos/azure-blob-storage.svg)Azure Blob Storage](https://weaveos.com/reference/azure-blob-storage)

  ### [How to list Azure Blob Storage versions](https://weaveos.com/reference/azure-blob-storage/list-blob-versions)

  Use List Blobs with include=versions for a programmatic inventory, or use az storage blob list --include v for a terminal inspection.

  API, CLI

- [![](https://weaveos.com/reference/logos/amazon-sns.svg)Amazon SNS](https://weaveos.com/reference/amazon-sns)

  ### [How to list Amazon SNS subscriptions for a topic](https://weaveos.com/reference/amazon-sns/list-topic-subscriptions)

  Use ListSubscriptionsByTopic to enumerate subscriptions for a known topic ARN. Use the AWS CLI when you want it to retrieve successive pages for you.

  API, CLI
