Skip to content
Start here

Buckets

List Buckets
client.r2.buckets.list(BucketListParams { account_id, cursor, direction, 5 more } params, RequestOptionsoptions?): BucketListResponse { buckets }
GET/accounts/{account_id}/r2/buckets
Get Bucket
client.r2.buckets.get(stringbucketName, BucketGetParams { account_id, jurisdiction } params, RequestOptionsoptions?): Bucket { creation_date, jurisdiction, location, 2 more }
GET/accounts/{account_id}/r2/buckets/{bucket_name}
Create Bucket
client.r2.buckets.create(BucketCreateParams { account_id, name, locationHint, 2 more } params, RequestOptionsoptions?): Bucket { creation_date, jurisdiction, location, 2 more }
POST/accounts/{account_id}/r2/buckets
Patch Bucket
client.r2.buckets.edit(stringbucketName, BucketEditParams { account_id, storage_class, jurisdiction } params, RequestOptionsoptions?): Bucket { creation_date, jurisdiction, location, 2 more }
PATCH/accounts/{account_id}/r2/buckets/{bucket_name}
Delete Bucket
client.r2.buckets.delete(stringbucketName, BucketDeleteParams { account_id, jurisdiction } params, RequestOptionsoptions?): BucketDeleteResponse
DELETE/accounts/{account_id}/r2/buckets/{bucket_name}
ModelsExpand Collapse
Bucket { creation_date, jurisdiction, location, 2 more }

A single R2 bucket.

creation_date?: string

Creation timestamp.

jurisdiction?: "default" | "eu" | "fedramp"

Jurisdiction where objects in this bucket are guaranteed to be stored.

One of the following:
"default"
"eu"
"fedramp"
location?: "apac" | "eeur" | "enam" | 3 more

Location of the bucket.

One of the following:
"apac"
"eeur"
"enam"
"weur"