Skip to main content

ListBuckets

ListBuckets returns the buckets in your account, in alphabetical order by name. Each STRG endpoint serves exactly one region, so the answer holds the buckets in the endpoint's region - and asking each regional endpoint in turn gives you every bucket you own.

Good to know on STRG
  • The list covers the endpoint's region, so one request per region adds up to your whole account - the examples include a loop that does it.
  • Every matching bucket comes back in one answer, so there is no next page to fetch. max-buckets and continuation-token are welcome and change nothing, and no ContinuationToken comes back.
  • BucketRegion and the echoed Prefix are left out of the response: every listed bucket is in the endpoint's region, and prefix still filters the list.
  • An access key limited to some buckets lists them when it holds List all bucket names; without it, ListBuckets answers 403 AccessDenied.

When you'd use it​

  • S3 tools getting started. File browsers, backup tools and commands such as aws s3 ls list the buckets first, to show what is there or to check that the credentials work.
  • Keeping an inventory. A nightly script asks each regional endpoint for its buckets and reports what exists where, or notices that a bucket it expects is missing.
  • Checking before creating. A deploy script can look for its own buckets by name with prefix - my-app-, say - and create only the ones that are not there yet.
  • An agent finding its way around. An AI agent handed an access key can list the buckets first, to learn where its work belongs before it reads or writes anything.

Request​

GET / HTTP/1.1
Host: s3.eu-central-1.strg.com
Authorization: AWS4-HMAC-SHA256 Credential=...
x-amz-date: 20260926T120000Z
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

ListBuckets names no bucket, so it always goes to the regional endpoint itself, s3.<region>.strg.com. A GET / on a virtual-hosted bucket hostname (my-bucket.s3.eu-central-1.strg.com) is ListObjects instead - Addressing explains both forms.

Permissions​

What a key sees depends on its scope:

Access keyResult
All bucketsEvery bucket in the endpoint's region.
Some buckets, with List all bucket names (buckets:list-all)Every bucket in the endpoint's region, including those the key cannot otherwise reach.
Some buckets, without List all bucket names403 AccessDenied.

Every access key holds List buckets (buckets:list). Many S3 tools and SDKs call ListBuckets before anything else, so a key limited to some buckets usually works best with List all bucket names as well. Access keys has the details.

URI parameters​

NameTypeRequiredDescription
prefixStringNoLists only buckets whose names begin with this string.
bucket-regionStringNoLists only buckets in this region. An endpoint lists its own region, so a value naming the endpoint's region changes nothing, and any other value returns an empty list.
max-bucketsIntegerNoWelcome, and changes nothing: every matching bucket comes back in one answer.
continuation-tokenStringNoWelcome, and changes nothing: STRG never returns a ContinuationToken, so there is never a next page to ask for.

Any other query parameter answers 501 NotImplemented, so a client knows straight away.

Request headers​

No operation-specific headers.

Request body​

None.

Response​

A successful request answers 200 OK with an XML body.

Response headers​

NameDescription
Content-Typeapplication/xml.
x-amz-request-idThe request ID, handy for a support request.

Response body​

ElementTypeDescription
ListAllMyBucketsResultContainerThe root element.
OwnerContainerThe account that owns the buckets.
Owner/IDStringYour STRG account ID.
Owner/DisplayNameStringYour STRG account ID, the same value as ID.
BucketsContainerThe buckets. Empty when none match.
Buckets/BucketContainerOne bucket.
Buckets/Bucket/NameStringThe bucket's name.
Buckets/Bucket/CreationDateTimestampWhen the bucket was created.
Buckets/Bucket/BucketRegionStringNot returned: every listed bucket is in the endpoint's region.
ContinuationTokenStringNot returned: the whole list is always in one answer.
PrefixStringNot returned, even when the request carried prefix.
<?xml version="1.0" encoding="UTF-8"?>
<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Owner>
<ID>usr_01K5ZQ8M3T4VW6XY7Z8A9BCDEF</ID>
<DisplayName>usr_01K5ZQ8M3T4VW6XY7Z8A9BCDEF</DisplayName>
</Owner>
<Buckets>
<Bucket>
<Name>my-bucket</Name>
<CreationDate>2026-01-15T09:30:00.000Z</CreationDate>
</Bucket>
<Bucket>
<Name>my-other-bucket</Name>
<CreationDate>2026-03-02T17:04:12.000Z</CreationDate>
</Bucket>
</Buckets>
</ListAllMyBucketsResult>

Errors​

These are the errors this request can return, and the situation behind each one.

CodeHTTP statusWhen
AccessDenied403The access key is limited to some buckets and does not hold List all bucket names, the account is not active, or the request is unsigned.
InvalidAccessKeyId403The access key does not exist, has expired or been revoked - or it was created moments ago and is not usable yet in this endpoint's region, in which case the same request works shortly afterwards.
SignatureDoesNotMatch403The request signature does not match.
RequestTimeTooSkewed403The request time is more than 15 minutes from the server's.
AuthorizationHeaderMalformed400The signature's credential scope names a region other than the endpoint's.
NotImplemented501The request carries a query parameter this operation does not take.
SlowDown503Too many requests. The Retry-After header says when a retry is welcome; the AWS SDKs retry on their own.
ServiceUnavailable503A temporary failure; the same request can be retried.

A region where your account has never stored anything answers 200 OK with an empty Buckets element, which is the truth: there are no buckets there. Listing across regions needs no special handling for it.

Differences from Amazon S3​

Each row is something STRG does its own way, and what that means for your code.

AspectAmazon S3STRG
Which bucketsEvery bucket in the account, from any regional endpointThe buckets in the endpoint's region. Asking each regional endpoint gives the whole account
Paginationmax-buckets and continuation-token page through the listEvery matching bucket is in one answer and no ContinuationToken comes back, so a paginating client simply finishes after its first page with the whole list
BucketRegionReturned for each bucketNot returned - every bucket listed is in the endpoint's region
Prefix in the responseEchoed when the request carried prefixNot returned. prefix still filters the list
Key limited to some bucketsGoverned by IAM policyLists every bucket in the region when the key holds List all bucket names; without it, 403 AccessDenied
Account with no storage in the region-An empty list, 200 OK
OwnerYour AWS canonical user IDYour STRG account ID, in both ID and DisplayName

Examples​

aws s3api list-buckets \
--endpoint-url https://s3.eu-central-1.strg.com \
--region eu-central-1

Only the buckets whose names begin with logs-:

aws s3api list-buckets \
--prefix logs- \
--endpoint-url https://s3.eu-central-1.strg.com \
--region eu-central-1

Listing every bucket in your account, by asking each regional endpoint:

for region in us-east-1 eu-central-1; do
aws s3api list-buckets \
--endpoint-url "https://s3.${region}.strg.com" \
--region "${region}" \
--query 'Buckets[].Name' \
--output text | tr '\t' '\n' | sed "s/^/${region} /"
done
View as Markdown