Source Code Bundles
Lists buckets associated with an account, in alphabetical order by bucket name.
When using an authorization token that is restricted to a bucket, you must include the bucketId or bucketName of that bucket in the request, or the request will be denied.
Request HTTP Headers
An authorization token, obtained from
Request HTTP Message Body Parameters
The ID of your account.
When bucketId is specified, the result will be a list containing just this bucket, if it's present in the account, or no buckets if the account does not have a bucket with this ID.
When bucketName is specified, the result will be a list containing just this bucket, if it's present in the account, or no buckets if the account does not have a bucket with this ID.
If present, B2 will use it as a filter for
bucket types returned in the list buckets response. If not present,
only buckets with bucket types "allPublic", "allPrivate" and "snapshot" will be returned.
A special filter value of ["all"] will return all bucket types.
Response HTTP Status 200
Bucket List as a JSON response:
An array of bucket objects (see below).
Each of the items in the array of buckets:
The account that the bucket is in.
The unique ID of the bucket.
The unique name of the bucket
One of: "allPublic", "allPrivate", "snapshot", or other values added in the future. "allPublic" means that anybody can download the files is the bucket; "allPrivate" means that you need an authorization token to download them; "snapshot" means that it's a private bucket containing snapshots created on the B2 web site.
The user data stored with this bucket.
The CORS rules for this bucket. See CORS Rules for an overview and the rule structure.
The list of lifecycle rules for this bucket. See Lifecycle Rules for an overview and the rule structure.
A counter that is updated every time the bucket is modified,
and can be used with the
When the call is not successful, the body of the response will be a JSON error structure. These are the status and codes that may be returned:
v2: Remove application key workaround (Sept 13, 2018)
Listing buckets will always return all buckets, unless you ask for just one by specifying
v1: Workaround for existing applications and application keys (August 9, 2018)
When using an application key that is restricted to a bucket, a request to list all buckets will return just that one bucket instead of returning "unauthorized".
v1: Application keys (July 26, 2018)
v1: Original release (September 22, 2015)B2 Cloud Storage was released.