---
title: Get R2 catalog details
---

[Skip to content](#_top)

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

[R2 Data Catalog](https://developers.cloudflare.com/api/go/resources/r2_data_catalog)

Copy Markdown

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

---

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

# Get R2 catalog details

Deprecated: Use \`GET /accounts/{account\_id}/basin-catalog/{bucket\_name}\` instead.

client.R2DataCatalog.Get(ctx, bucketName, query) (\*[R2DataCatalogGetResponse](<https://developers.cloudflare.com/api/go/resources/r2_data_catalog#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/r2-catalog/{bucket\_name}

Retrieve detailed information about a specific R2 catalog by bucket name. Returns catalog status, maintenance configuration, and credential status.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**<code>X-Auth-Email: user@example.com</code>

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### Accepted Permissions (at least one required)

`Workers R2 Data Catalog Write``Workers R2 Data Catalog Read`

##### ParametersExpand Collapse

bucketName string

Specifies the R2 bucket name.

maxLength63

minLength3

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

<details>

<summary>

query R2DataCatalogGetParams

</summary>

AccountID param.Field\[string]

Use this to identify the account.

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

</details>

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

##### ReturnsExpand Collapse

<details>

<summary>

type R2DataCatalogGetResponse struct{…}

Contains catalog information.

</summary>

ID string

Use this to uniquely identify the catalog.

formatuuid

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

Bucket string

Specifies the associated R2 bucket name.

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20bucket">Link to this property</a>

Name string

Specifies the catalog name (generated from account and bucket name).

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

<details>

<summary>

Status R2DataCatalogGetResponseStatus

Indicates the status of the catalog.

</summary>

One of the following:

const R2DataCatalogGetResponseStatusActive R2DataCatalogGetResponseStatus = "active"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%200">Link to this property</a>

const R2DataCatalogGetResponseStatusInactive R2DataCatalogGetResponseStatus = "inactive"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20status">Link to this property</a>

<details>

<summary>

CredentialStatus R2DataCatalogGetResponseCredentialStatusOptional

Shows the credential configuration status.

</summary>

One of the following:

const R2DataCatalogGetResponseCredentialStatusPresent R2DataCatalogGetResponseCredentialStatus = "present"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20credential_status%20%3E%20(member)%200">Link to this property</a>

const R2DataCatalogGetResponseCredentialStatusAbsent R2DataCatalogGetResponseCredentialStatus = "absent"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20credential_status%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20credential_status">Link to this property</a>

<details>

<summary>

MaintenanceConfig R2DataCatalogGetResponseMaintenanceConfigOptional

Configures maintenance for the catalog.

</summary>

<details>

<summary>

Compaction R2DataCatalogGetResponseMaintenanceConfigCompactionOptional

Configures compaction for catalog maintenance.

</summary>

<details>

<summary>

State R2DataCatalogGetResponseMaintenanceConfigCompactionState

Specifies the state of maintenance operations.

</summary>

One of the following:

const R2DataCatalogGetResponseMaintenanceConfigCompactionStateEnabled R2DataCatalogGetResponseMaintenanceConfigCompactionState = "enabled"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20compaction%20%3E%20(property)%20state%20%3E%20(member)%200">Link to this property</a>

const R2DataCatalogGetResponseMaintenanceConfigCompactionStateDisabled R2DataCatalogGetResponseMaintenanceConfigCompactionState = "disabled"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20compaction%20%3E%20(property)%20state%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20compaction%20%3E%20(property)%20state">Link to this property</a>

<details>

<summary>

TargetSizeMB R2DataCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB

Sets the target file size for compaction in megabytes. Defaults to “128”.

</summary>

One of the following:

const R2DataCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB64 R2DataCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB = "64"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20compaction%20%3E%20(property)%20target_size_mb%20%3E%20(member)%200">Link to this property</a>

const R2DataCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB128 R2DataCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB = "128"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20compaction%20%3E%20(property)%20target_size_mb%20%3E%20(member)%201">Link to this property</a>

const R2DataCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB256 R2DataCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB = "256"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20compaction%20%3E%20(property)%20target_size_mb%20%3E%20(member)%202">Link to this property</a>

const R2DataCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB512 R2DataCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB = "512"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20compaction%20%3E%20(property)%20target_size_mb%20%3E%20(member)%203">Link to this property</a>

</details>

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20compaction%20%3E%20(property)%20target_size_mb">Link to this property</a>

</details>

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20compaction">Link to this property</a>

Interval stringOptional

Scheduling interval between normal table maintenance runs.

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20interval">Link to this property</a>

<details>

<summary>

SnapshotExpiration R2DataCatalogGetResponseMaintenanceConfigSnapshotExpirationOptional

Configures snapshot expiration settings.

</summary>

MaxSnapshotAge string

Specifies the maximum age for snapshots. The system deletes snapshots older than this age. Format: where unit is d (days), h (hours), m (minutes), or s (seconds). Examples: “7d” (7 days), “48h” (48 hours), “2880m” (2,880 minutes). Defaults to “7d”.

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20snapshot_expiration%20%3E%20(property)%20max_snapshot_age">Link to this property</a>

MinSnapshotsToKeep int64

Specifies the minimum number of snapshots to retain. Defaults to 100.

formatint64

minimum1

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20snapshot_expiration%20%3E%20(property)%20min_snapshots_to_keep">Link to this property</a>

<details>

<summary>

State R2DataCatalogGetResponseMaintenanceConfigSnapshotExpirationState

Specifies the state of maintenance operations.

</summary>

One of the following:

const R2DataCatalogGetResponseMaintenanceConfigSnapshotExpirationStateEnabled R2DataCatalogGetResponseMaintenanceConfigSnapshotExpirationState = "enabled"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20snapshot_expiration%20%3E%20(property)%20state%20%3E%20(member)%200">Link to this property</a>

const R2DataCatalogGetResponseMaintenanceConfigSnapshotExpirationStateDisabled R2DataCatalogGetResponseMaintenanceConfigSnapshotExpirationState = "disabled"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20snapshot_expiration%20%3E%20(property)%20state%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20snapshot_expiration%20%3E%20(property)%20state">Link to this property</a>

</details>

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20snapshot_expiration">Link to this property</a>

</details>

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)%20%3E%20(property)%20maintenance_config">Link to this property</a>

</details>

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogGetResponse%20%3E%20(schema)>)

### Get R2 catalog details

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  r2DataCatalog, err := client.R2DataCatalog.Get(
    context.TODO(),
    "my-data-bucket",
    r2_data_catalog.R2DataCatalogGetParams{
      AccountID: cloudflare.F("0123456789abcdef0123456789abcdef"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", r2DataCatalog.ID)
}
```

200 example

```
{
  "errors": [],
  "messages": [],
  "result": {
    "bucket": "analytics-bucket",
    "credential_status": "present",
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "maintenance_config": {
      "compaction": {
        "state": "enabled",
        "target_size_mb": "128"
      },
      "snapshot_expiration": {
        "max_snapshot_age": "7d",
        "min_snapshots_to_keep": 100,
        "state": "enabled"
      }
    },
    "name": "account123_analytics-bucket",
    "status": "active"
  },
  "success": true
}
```

##### Returns Examples

200 example

```
{
  "errors": [],
  "messages": [],
  "result": {
    "bucket": "analytics-bucket",
    "credential_status": "present",
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "maintenance_config": {
      "compaction": {
        "state": "enabled",
        "target_size_mb": "128"
      },
      "snapshot_expiration": {
        "max_snapshot_age": "7d",
        "min_snapshots_to_keep": 100,
        "state": "enabled"
      }
    },
    "name": "account123_analytics-bucket",
    "status": "active"
  },
  "success": true
}
```