---
title: List R2 catalogs
---

[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**

# List R2 catalogs

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

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

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

Returns a list of R2 buckets that have been enabled as Apache Iceberg catalogs for the specified account. Each catalog represents an R2 bucket configured to store Iceberg metadata and data files.

##### 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

<details>

<summary>

query R2DataCatalogListParams

</summary>

AccountID param.Field\[string]

Use this to identify the account.

<a href="#(resource)%20r2_data_catalog%20%3E%20(method)%20list%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)%20list%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

type R2DataCatalogListResponse struct{…}

Contains the list of catalogs.

</summary>

<details>

<summary>

Warehouses \[]R2DataCatalogListResponseWarehouse

Lists catalogs in the account.

</summary>

ID string

Use this to uniquely identify the catalog.

formatuuid

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%20%3E%20(property)%20name">Link to this property</a>

<details>

<summary>

Status R2DataCatalogListResponseWarehousesStatus

Indicates the status of the catalog.

</summary>

One of the following:

const R2DataCatalogListResponseWarehousesStatusActive R2DataCatalogListResponseWarehousesStatus = "active"

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

const R2DataCatalogListResponseWarehousesStatusInactive R2DataCatalogListResponseWarehousesStatus = "inactive"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%20%3E%20(property)%20status">Link to this property</a>

<details>

<summary>

CredentialStatus R2DataCatalogListResponseWarehousesCredentialStatusOptional

Shows the credential configuration status.

</summary>

One of the following:

const R2DataCatalogListResponseWarehousesCredentialStatusPresent R2DataCatalogListResponseWarehousesCredentialStatus = "present"

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

const R2DataCatalogListResponseWarehousesCredentialStatusAbsent R2DataCatalogListResponseWarehousesCredentialStatus = "absent"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%20%3E%20(property)%20credential_status">Link to this property</a>

<details>

<summary>

MaintenanceConfig R2DataCatalogListResponseWarehousesMaintenanceConfigOptional

Configures maintenance for the catalog.

</summary>

<details>

<summary>

Compaction R2DataCatalogListResponseWarehousesMaintenanceConfigCompactionOptional

Configures compaction for catalog maintenance.

</summary>

<details>

<summary>

State R2DataCatalogListResponseWarehousesMaintenanceConfigCompactionState

Specifies the state of maintenance operations.

</summary>

One of the following:

const R2DataCatalogListResponseWarehousesMaintenanceConfigCompactionStateEnabled R2DataCatalogListResponseWarehousesMaintenanceConfigCompactionState = "enabled"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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 R2DataCatalogListResponseWarehousesMaintenanceConfigCompactionStateDisabled R2DataCatalogListResponseWarehousesMaintenanceConfigCompactionState = "disabled"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20compaction%20%3E%20(property)%20state">Link to this property</a>

<details>

<summary>

TargetSizeMB R2DataCatalogListResponseWarehousesMaintenanceConfigCompactionTargetSizeMB

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

</summary>

One of the following:

const R2DataCatalogListResponseWarehousesMaintenanceConfigCompactionTargetSizeMB64 R2DataCatalogListResponseWarehousesMaintenanceConfigCompactionTargetSizeMB = "64"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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 R2DataCatalogListResponseWarehousesMaintenanceConfigCompactionTargetSizeMB128 R2DataCatalogListResponseWarehousesMaintenanceConfigCompactionTargetSizeMB = "128"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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 R2DataCatalogListResponseWarehousesMaintenanceConfigCompactionTargetSizeMB256 R2DataCatalogListResponseWarehousesMaintenanceConfigCompactionTargetSizeMB = "256"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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 R2DataCatalogListResponseWarehousesMaintenanceConfigCompactionTargetSizeMB512 R2DataCatalogListResponseWarehousesMaintenanceConfigCompactionTargetSizeMB = "512"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%20%3E%20(property)%20maintenance_config%20%3E%20(property)%20interval">Link to this property</a>

<details>

<summary>

SnapshotExpiration R2DataCatalogListResponseWarehousesMaintenanceConfigSnapshotExpirationOptional

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)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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 R2DataCatalogListResponseWarehousesMaintenanceConfigSnapshotExpirationState

Specifies the state of maintenance operations.

</summary>

One of the following:

const R2DataCatalogListResponseWarehousesMaintenanceConfigSnapshotExpirationStateEnabled R2DataCatalogListResponseWarehousesMaintenanceConfigSnapshotExpirationState = "enabled"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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 R2DataCatalogListResponseWarehousesMaintenanceConfigSnapshotExpirationStateDisabled R2DataCatalogListResponseWarehousesMaintenanceConfigSnapshotExpirationState = "disabled"

<a href="#(resource)%20r2_data_catalog%20%3E%20(model)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%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)%20R2DataCatalogListResponse%20%3E%20(schema)%20%3E%20(property)%20warehouses%20%3E%20(items)%20%3E%20(property)%20maintenance_config">Link to this property</a>

</details>

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

</details>

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

### List R2 catalogs

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"),
  )
  r2DataCatalogs, err := client.R2DataCatalog.List(context.TODO(), r2_data_catalog.R2DataCatalogListParams{
    AccountID: cloudflare.F("0123456789abcdef0123456789abcdef"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", r2DataCatalogs.Warehouses)
}
```

200 example

```
{
  "errors": [],
  "messages": [],
  "result": {
    "warehouses": [
      {
        "bucket": "analytics-bucket",
        "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"
      },
      {
        "bucket": "logs-bucket",
        "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
        "maintenance_config": {
          "compaction": {
            "state": "disabled",
            "target_size_mb": "128"
          },
          "snapshot_expiration": {
            "max_snapshot_age": "7d",
            "min_snapshots_to_keep": 100,
            "state": "disabled"
          }
        },
        "name": "account123_logs-bucket",
        "status": "inactive"
      }
    ]
  },
  "success": true
}
```

##### Returns Examples

200 example

```
{
  "errors": [],
  "messages": [],
  "result": {
    "warehouses": [
      {
        "bucket": "analytics-bucket",
        "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"
      },
      {
        "bucket": "logs-bucket",
        "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
        "maintenance_config": {
          "compaction": {
            "state": "disabled",
            "target_size_mb": "128"
          },
          "snapshot_expiration": {
            "max_snapshot_age": "7d",
            "min_snapshots_to_keep": 100,
            "state": "disabled"
          }
        },
        "name": "account123_logs-bucket",
        "status": "inactive"
      }
    ]
  },
  "success": true
}
```