---
title: Get Bucket
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/go)

[R2](https://developers.cloudflare.com/api/go/resources/r2)

[Buckets](https://developers.cloudflare.com/api/go/resources/r2/subresources/buckets)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Get Bucket

client.R2.Buckets.Get(ctx, bucketName, params) (\*[Bucket](<https://developers.cloudflare.com/api/go/resources/r2#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/r2/buckets/{bucket\_name}

Gets properties of an existing R2 bucket.

##### Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. [Create a token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/).

**Example:**`Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY`

##### ParametersExpand Collapse

bucketName string

Name of the bucket.

maxLength64

minLength3

[Link to this property](<#(resource)%20r2.buckets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20bucket_name%20%3E%20(schema)>)

<details>

<summary>

params BucketGetParams

</summary>

AccountID param.Field\[string]

Path param: Cloudflare account ID that owns the R2 resource.

maxLength32

<a href="#(resource)%20r2.buckets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

<details>

<summary>

CfR2Jurisdiction param.Field\[<a href="https://developers.cloudflare.com/api/go/resources/r2/subresources/buckets/methods/get#(resource)%20r2.buckets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)">BucketGetParamsCfR2Jurisdiction</a>]Optional

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

</summary>

const BucketGetParamsCfR2JurisdictionDefault <a href="https://developers.cloudflare.com/api/go/resources/r2/subresources/buckets/methods/get#(resource)%20r2.buckets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)">BucketGetParamsCfR2Jurisdiction</a> = "default"

<a href="#(resource)%20r2.buckets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)%20%3E%20(member)%200">Link to this property</a>

const BucketGetParamsCfR2JurisdictionEu <a href="https://developers.cloudflare.com/api/go/resources/r2/subresources/buckets/methods/get#(resource)%20r2.buckets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)">BucketGetParamsCfR2Jurisdiction</a> = "eu"

<a href="#(resource)%20r2.buckets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)%20%3E%20(member)%201">Link to this property</a>

const BucketGetParamsCfR2JurisdictionUs <a href="https://developers.cloudflare.com/api/go/resources/r2/subresources/buckets/methods/get#(resource)%20r2.buckets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)">BucketGetParamsCfR2Jurisdiction</a> = "us"

<a href="#(resource)%20r2.buckets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)%20%3E%20(member)%202">Link to this property</a>

const BucketGetParamsCfR2JurisdictionFedramp <a href="https://developers.cloudflare.com/api/go/resources/r2/subresources/buckets/methods/get#(resource)%20r2.buckets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)">BucketGetParamsCfR2Jurisdiction</a> = "fedramp"

<a href="#(resource)%20r2.buckets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)%20%3E%20(member)%203">Link to this property</a>

const BucketGetParamsCfR2JurisdictionFedrampHigh <a href="https://developers.cloudflare.com/api/go/resources/r2/subresources/buckets/methods/get#(resource)%20r2.buckets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)">BucketGetParamsCfR2Jurisdiction</a> = "fedramp-high"

<a href="#(resource)%20r2.buckets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)%20%3E%20(member)%204">Link to this property</a>

</details>

<a href="#(resource)%20r2.buckets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction">Link to this property</a>

</details>

[Link to this property](<#(resource)%20r2.buckets%20%3E%20(method)%20get%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

type Bucket struct{…}

A single R2 bucket.

</summary>

CreationDate stringOptional

Creation timestamp.

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20creation_date">Link to this property</a>

<details>

<summary>

Jurisdiction BucketJurisdictionOptional

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

</summary>

One of the following:

const BucketJurisdictionDefault BucketJurisdiction = "default"

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20jurisdiction%20%3E%20(member)%200">Link to this property</a>

const BucketJurisdictionEu BucketJurisdiction = "eu"

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20jurisdiction%20%3E%20(member)%201">Link to this property</a>

const BucketJurisdictionUs BucketJurisdiction = "us"

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20jurisdiction%20%3E%20(member)%202">Link to this property</a>

const BucketJurisdictionFedramp BucketJurisdiction = "fedramp"

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20jurisdiction%20%3E%20(member)%203">Link to this property</a>

const BucketJurisdictionFedrampHigh BucketJurisdiction = "fedramp-high"

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20jurisdiction%20%3E%20(member)%204">Link to this property</a>

</details>

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20jurisdiction">Link to this property</a>

<details>

<summary>

Location BucketLocationOptional

Location of the bucket.

</summary>

One of the following:

const BucketLocationApac BucketLocation = "apac"

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20location%20%3E%20(member)%200">Link to this property</a>

const BucketLocationEeur BucketLocation = "eeur"

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20location%20%3E%20(member)%201">Link to this property</a>

const BucketLocationEnam BucketLocation = "enam"

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20location%20%3E%20(member)%202">Link to this property</a>

const BucketLocationWeur BucketLocation = "weur"

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20location%20%3E%20(member)%203">Link to this property</a>

const BucketLocationWnam BucketLocation = "wnam"

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20location%20%3E%20(member)%204">Link to this property</a>

const BucketLocationOc BucketLocation = "oc"

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20location%20%3E%20(member)%205">Link to this property</a>

</details>

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20location">Link to this property</a>

Name stringOptional

Name of the bucket.

maxLength64

minLength3

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

<details>

<summary>

StorageClass BucketStorageClassOptional

Storage class for newly uploaded objects, unless specified otherwise.

</summary>

One of the following:

const BucketStorageClassStandard BucketStorageClass = "Standard"

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20storage_class%20%3E%20(member)%200">Link to this property</a>

const BucketStorageClassInfrequentAccess BucketStorageClass = "InfrequentAccess"

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20storage_class%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)%20%3E%20(property)%20storage_class">Link to this property</a>

</details>

[Link to this property](<#(resource)%20r2.buckets%20%3E%20(model)%20bucket%20%3E%20(schema)>)

### Get Bucket

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/r2"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  bucket, err := client.R2.Buckets.Get(
    context.TODO(),
    "example-bucket",
    r2.BucketGetParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", bucket.CreationDate)
}
```

200 example

```
{
  "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
}
```

##### Returns Examples

200 example

```
{
  "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
}
```