ListBuckets - Amazon Simple Storage Service

ListBuckets

Note

This operation is not supported by directory buckets.

Returns a list of all buckets owned by the authenticated sender of the request. To use this operation, you must have the s3:ListAllMyBuckets permission.

For information about Amazon S3 buckets, see Creating, configuring, and working with Amazon S3 buckets.

Request Syntax

GET / HTTP/1.1 Host: s3.amazonaws.com

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200 <?xml version="1.0" encoding="UTF-8"?> <ListAllMyBucketsResult> <Buckets> <Bucket> <CreationDate>timestamp</CreationDate> <Name>string</Name> </Bucket> </Buckets> <Owner> <DisplayName>string</DisplayName> <ID>string</ID> </Owner> </ListAllMyBucketsResult>

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in XML format by the service.

ListAllMyBucketsResult

Root level tag for the ListAllMyBucketsResult parameters.

Required: Yes

Buckets

The list of buckets owned by the requester.

Type: Array of Bucket data types

Owner

The owner of the buckets listed.

Type: Owner data type

Examples

Sample Request

The following request returns a list of all buckets of the sender.

HTTP/1.1 200 OK <ListAllMyBucketsResult> <Buckets> <Bucket> <CreationDate>2019-12-11T23:32:47+00:00</CreationDate> <String>DOC-EXAMPLE-BUCKET</String> </Bucket> <Bucket> <CreationDate>2019-11-10T23:32:13+00:00</CreationDate> <String>DOC-EXAMPLE-BUCKET2</String> </Bucket> </Buckets> <Owner> <DisplayName>Account+Name</DisplayName> <ID>AIDACKCEVSQ6C2EXAMPLE</ID> </Owner> </ListAllMyBucketsResult>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: