## Create Bucket `client.r2.buckets.create(BucketCreateParamsparams, RequestOptionsoptions?): Bucket` **post** `/accounts/{account_id}/r2/buckets` Creates a new R2 bucket. ### Parameters - `params: BucketCreateParams` - `account_id: string` Path param: Account ID. - `name: string` Body param: Name of the bucket. - `locationHint?: "apac" | "eeur" | "enam" | 3 more` Body param: Location of the bucket. - `"apac"` - `"eeur"` - `"enam"` - `"weur"` - `"wnam"` - `"oc"` - `storageClass?: "Standard" | "InfrequentAccess"` Body param: Storage class for newly uploaded objects, unless specified otherwise. - `"Standard"` - `"InfrequentAccess"` - `jurisdiction?: "default" | "eu" | "fedramp"` Header param: Jurisdiction where objects in this bucket are guaranteed to be stored. - `"default"` - `"eu"` - `"fedramp"` ### Returns - `Bucket` A single R2 bucket. - `creation_date?: string` Creation timestamp. - `jurisdiction?: "default" | "eu" | "fedramp"` Jurisdiction where objects in this bucket are guaranteed to be stored. - `"default"` - `"eu"` - `"fedramp"` - `location?: "apac" | "eeur" | "enam" | 3 more` Location of the bucket. - `"apac"` - `"eeur"` - `"enam"` - `"weur"` - `"wnam"` - `"oc"` - `name?: string` Name of the bucket. - `storage_class?: "Standard" | "InfrequentAccess"` Storage class for newly uploaded objects, unless specified otherwise. - `"Standard"` - `"InfrequentAccess"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const bucket = await client.r2.buckets.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'example-bucket', }); console.log(bucket.creation_date); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ "string" ], "result": { "creation_date": "creation_date", "jurisdiction": "default", "location": "apac", "name": "example-bucket", "storage_class": "Standard" }, "success": true } ```