Skip to content
Start here

R2 Data Catalog

List R2 catalogs
client.r2DataCatalog.list(R2DataCatalogListParams { account_id } params, RequestOptionsoptions?): R2DataCatalogListResponse { warehouses }
GET/accounts/{account_id}/r2-catalog
Get R2 catalog details
client.r2DataCatalog.get(stringbucketName, R2DataCatalogGetParams { account_id } params, RequestOptionsoptions?): R2DataCatalogGetResponse { id, bucket, name, 3 more }
GET/accounts/{account_id}/r2-catalog/{bucket_name}
Enable R2 bucket as a catalog
client.r2DataCatalog.enable(stringbucketName, R2DataCatalogEnableParams { account_id } params, RequestOptionsoptions?): R2DataCatalogEnableResponse { id, name }
POST/accounts/{account_id}/r2-catalog/{bucket_name}/enable
Disable R2 catalog
client.r2DataCatalog.disable(stringbucketName, R2DataCatalogDisableParams { account_id } params, RequestOptionsoptions?): void
POST/accounts/{account_id}/r2-catalog/{bucket_name}/disable
ModelsExpand Collapse
R2DataCatalogListResponse { warehouses }

Contains the list of catalogs.

warehouses: Array<Warehouse>

Lists catalogs in the account.

id: string

Use this to uniquely identify the catalog.

formatuuid
bucket: string

Specifies the associated R2 bucket name.

name: string

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

status: "active" | "inactive"

Indicates the status of the catalog.

One of the following:
"active"
"inactive"
credential_status?: "present" | "absent" | null

Shows the credential configuration status.

One of the following:
"present"
"absent"
maintenance_config?: MaintenanceConfig | null

Configures maintenance for the catalog.

compaction?: Compaction { state, target_size_mb }

Configures compaction for catalog maintenance.

state: "enabled" | "disabled"

Specifies the state of maintenance operations.

One of the following:
"enabled"
"disabled"
target_size_mb: "64" | "128" | "256" | "512"

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

One of the following:
"64"
"128"
"256"
"512"
snapshot_expiration?: SnapshotExpiration { max_snapshot_age, min_snapshots_to_keep, state }

Configures snapshot expiration settings.

max_snapshot_age: 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".

min_snapshots_to_keep: number

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

formatint64
minimum1
state: "enabled" | "disabled"

Specifies the state of maintenance operations.

One of the following:
"enabled"
"disabled"
R2DataCatalogGetResponse { id, bucket, name, 3 more }

Contains R2 Data Catalog information.

id: string

Use this to uniquely identify the catalog.

formatuuid
bucket: string

Specifies the associated R2 bucket name.

name: string

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

status: "active" | "inactive"

Indicates the status of the catalog.

One of the following:
"active"
"inactive"
credential_status?: "present" | "absent" | null

Shows the credential configuration status.

One of the following:
"present"
"absent"
maintenance_config?: MaintenanceConfig | null

Configures maintenance for the catalog.

compaction?: Compaction { state, target_size_mb }

Configures compaction for catalog maintenance.

state: "enabled" | "disabled"

Specifies the state of maintenance operations.

One of the following:
"enabled"
"disabled"
target_size_mb: "64" | "128" | "256" | "512"

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

One of the following:
"64"
"128"
"256"
"512"
snapshot_expiration?: SnapshotExpiration { max_snapshot_age, min_snapshots_to_keep, state }

Configures snapshot expiration settings.

max_snapshot_age: 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".

min_snapshots_to_keep: number

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

formatint64
minimum1
state: "enabled" | "disabled"

Specifies the state of maintenance operations.

One of the following:
"enabled"
"disabled"
R2DataCatalogEnableResponse { id, name }

Contains response from activating an R2 bucket as a catalog.

id: string

Use this to uniquely identify the activated catalog.

formatuuid
name: string

Specifies the name of the activated catalog.

R2 Data CatalogMaintenance Configs

Get catalog maintenance configuration
client.r2DataCatalog.maintenanceConfigs.get(stringbucketName, MaintenanceConfigGetParams { account_id } params, RequestOptionsoptions?): MaintenanceConfigGetResponse { credential_status, maintenance_config }
GET/accounts/{account_id}/r2-catalog/{bucket_name}/maintenance-configs
Update catalog maintenance configuration
client.r2DataCatalog.maintenanceConfigs.update(stringbucketName, MaintenanceConfigUpdateParams { account_id, compaction, snapshot_expiration } params, RequestOptionsoptions?): MaintenanceConfigUpdateResponse { compaction, snapshot_expiration }
POST/accounts/{account_id}/r2-catalog/{bucket_name}/maintenance-configs
ModelsExpand Collapse
MaintenanceConfigGetResponse { credential_status, maintenance_config }

Contains maintenance configuration and credential status.

credential_status: "present" | "absent"

Shows the credential configuration status.

One of the following:
"present"
"absent"
maintenance_config: MaintenanceConfig { compaction, snapshot_expiration }

Configures maintenance for the catalog.

compaction?: Compaction { state, target_size_mb }

Configures compaction for catalog maintenance.

state: "enabled" | "disabled"

Specifies the state of maintenance operations.

One of the following:
"enabled"
"disabled"
target_size_mb: "64" | "128" | "256" | "512"

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

One of the following:
"64"
"128"
"256"
"512"
snapshot_expiration?: SnapshotExpiration { max_snapshot_age, min_snapshots_to_keep, state }

Configures snapshot expiration settings.

max_snapshot_age: 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".

min_snapshots_to_keep: number

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

formatint64
minimum1
state: "enabled" | "disabled"

Specifies the state of maintenance operations.

One of the following:
"enabled"
"disabled"
MaintenanceConfigUpdateResponse { compaction, snapshot_expiration }

Configures maintenance for the catalog.

compaction?: Compaction { state, target_size_mb }

Configures compaction for catalog maintenance.

state: "enabled" | "disabled"

Specifies the state of maintenance operations.

One of the following:
"enabled"
"disabled"
target_size_mb: "64" | "128" | "256" | "512"

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

One of the following:
"64"
"128"
"256"
"512"
snapshot_expiration?: SnapshotExpiration { max_snapshot_age, min_snapshots_to_keep, state }

Configures snapshot expiration settings.

max_snapshot_age: 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".

min_snapshots_to_keep: number

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

formatint64
minimum1
state: "enabled" | "disabled"

Specifies the state of maintenance operations.

One of the following:
"enabled"
"disabled"

R2 Data CatalogCredentials

Store catalog credentials
client.r2DataCatalog.credentials.create(stringbucketName, CredentialCreateParams { account_id, token } params, RequestOptionsoptions?): CredentialCreateResponse | null
POST/accounts/{account_id}/r2-catalog/{bucket_name}/credential
ModelsExpand Collapse
CredentialCreateResponse = unknown

R2 Data CatalogNamespaces

List namespaces in catalog
client.r2DataCatalog.namespaces.list(stringbucketName, NamespaceListParams { account_id, page_size, page_token, 3 more } params, RequestOptionsoptions?): NamespaceListResponse { namespaces, details, namespace_uuids, next_page_token }
GET/accounts/{account_id}/r2-catalog/{bucket_name}/namespaces
ModelsExpand Collapse
NamespaceListResponse { namespaces, details, namespace_uuids, next_page_token }

Contains the list of namespaces with optional pagination.

namespaces: Array<Array<string>>

Lists namespaces in the catalog.

details?: Array<Detail> | null

Contains detailed metadata for each namespace when return_details is true. Each object includes the namespace, UUID, and timestamps.

namespace: Array<string>

Specifies the hierarchical namespace parts as an array of strings. For example, ["bronze", "analytics"] represents the namespace "bronze.analytics".

namespace_uuid: string

Contains the UUID that persists across renames.

formatuuid
created_at?: string | null

Indicates the creation timestamp in ISO 8601 format.

formatdate-time
updated_at?: string | null

Shows the last update timestamp in ISO 8601 format. Null if never updated.

formatdate-time
namespace_uuids?: Array<string> | null

Contains UUIDs for each namespace when return_uuids is true. The order corresponds to the namespaces array.

next_page_token?: string | null

Use this opaque token to fetch the next page of results. A null or absent value indicates the last page.

R2 Data CatalogNamespacesTables

List tables in namespace
client.r2DataCatalog.namespaces.tables.list(stringbucketName, stringnamespace, TableListParams { account_id, page_size, page_token, 2 more } params, RequestOptionsoptions?): TableListResponse { identifiers, details, next_page_token, table_uuids }
GET/accounts/{account_id}/r2-catalog/{bucket_name}/namespaces/{namespace}/tables
ModelsExpand Collapse
TableListResponse { identifiers, details, next_page_token, table_uuids }

Contains the list of tables with optional pagination.

identifiers: Array<Identifier>

Lists tables in the namespace.

name: string

Specifies the table name.

namespace: Array<string>

Specifies the hierarchical namespace parts as an array of strings. For example, ["bronze", "analytics"] represents the namespace "bronze.analytics".

details?: Array<Detail> | null

Contains detailed metadata for each table when return_details is true. Each object includes identifier, UUID, timestamps, and locations.

identifier: Identifier { name, namespace }

Specifies a unique table identifier within a catalog.

name: string

Specifies the table name.

namespace: Array<string>

Specifies the hierarchical namespace parts as an array of strings. For example, ["bronze", "analytics"] represents the namespace "bronze.analytics".

table_uuid: string

Contains the UUID that persists across renames.

formatuuid
created_at?: string | null

Indicates the creation timestamp in ISO 8601 format.

formatdate-time
location?: string | null

Specifies the base S3 URI for table storage location.

metadata_location?: string | null

Contains the S3 URI to table metadata file. Null for staged tables.

updated_at?: string | null

Shows the last update timestamp in ISO 8601 format. Null if never updated.

formatdate-time
next_page_token?: string | null

Use this opaque token to fetch the next page of results. A null or absent value indicates the last page.

table_uuids?: Array<string> | null

Contains UUIDs for each table when return_uuids is true. The order corresponds to the identifiers array.

R2 Data CatalogNamespacesTablesMaintenance Configs

Get table maintenance configuration
client.r2DataCatalog.namespaces.tables.maintenanceConfigs.get(stringbucketName, stringnamespace, stringtableName, MaintenanceConfigGetParams { account_id } params, RequestOptionsoptions?): MaintenanceConfigGetResponse { maintenance_config }
GET/accounts/{account_id}/r2-catalog/{bucket_name}/namespaces/{namespace}/tables/{table_name}/maintenance-configs
Update table maintenance configuration
client.r2DataCatalog.namespaces.tables.maintenanceConfigs.update(stringbucketName, stringnamespace, stringtableName, MaintenanceConfigUpdateParams { account_id, compaction, snapshot_expiration } params, RequestOptionsoptions?): MaintenanceConfigUpdateResponse { compaction, snapshot_expiration }
POST/accounts/{account_id}/r2-catalog/{bucket_name}/namespaces/{namespace}/tables/{table_name}/maintenance-configs
ModelsExpand Collapse
MaintenanceConfigGetResponse { maintenance_config }

Contains table maintenance configuration.

maintenance_config: MaintenanceConfig { compaction, snapshot_expiration }

Configures maintenance for the table.

compaction?: Compaction { state, target_size_mb }

Configures compaction settings for table optimization.

state: "enabled" | "disabled"

Specifies the state of maintenance operations.

One of the following:
"enabled"
"disabled"
target_size_mb: "64" | "128" | "256" | "512"

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

One of the following:
"64"
"128"
"256"
"512"
snapshot_expiration?: SnapshotExpiration { max_snapshot_age, min_snapshots_to_keep, state }

Configures snapshot expiration settings.

max_snapshot_age: 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".

min_snapshots_to_keep: number

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

formatint64
minimum1
state: "enabled" | "disabled"

Specifies the state of maintenance operations.

One of the following:
"enabled"
"disabled"
MaintenanceConfigUpdateResponse { compaction, snapshot_expiration }

Configures maintenance for the table.

compaction?: Compaction { state, target_size_mb }

Configures compaction settings for table optimization.

state: "enabled" | "disabled"

Specifies the state of maintenance operations.

One of the following:
"enabled"
"disabled"
target_size_mb: "64" | "128" | "256" | "512"

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

One of the following:
"64"
"128"
"256"
"512"
snapshot_expiration?: SnapshotExpiration { max_snapshot_age, min_snapshots_to_keep, state }

Configures snapshot expiration settings.

max_snapshot_age: 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".

min_snapshots_to_keep: number

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

formatint64
minimum1
state: "enabled" | "disabled"

Specifies the state of maintenance operations.

One of the following:
"enabled"
"disabled"