R2 Data Catalog

r2_data_catalog

Methods

List R2 Catalogs -> Envelope<{ warehouses }>
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.

Get R2 Catalog Details -> Envelope<{ id, bucket, name, 3 more... }>
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.

Enable R2 Bucket As A Catalog -> Envelope<{ id, name }>
post/accounts/{account_id}/r2-catalog/{bucket_name}/enable

Enable an R2 bucket as an Apache Iceberg catalog. This operation creates the necessary catalog infrastructure and activates the bucket for storing Iceberg metadata and data files.

Security

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example: Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY

Accepted Permissions (at least one required)

Workers R2 Data Catalog Write

path Parameters
account_id: string

Use this to identify the account.

bucket_name: string
(maxLength: 63, minLength: 3)

Specifies the R2 bucket name.

Response fields
errors: Array<{ code, message }>

Contains errors if the API call was unsuccessful.

messages: Array<{ code, message }>

Contains informational messages.

success: boolean

Indicates whether the API call was successful.

result: { id, name }
Optional

Contains response from activating an R2 bucket as a catalog.

Request example
200Example
Disable R2 Catalog ->
post/accounts/{account_id}/r2-catalog/{bucket_name}/disable

Disable an R2 bucket as a catalog. This operation deactivates the catalog but preserves existing metadata and data files. The catalog can be re-enabled later.

R2 Data Catalog

Credentials

r2_data_catalog.credentials

Methods

Store Catalog Credentials -> Envelope<unknown>
post/accounts/{account_id}/r2-catalog/{bucket_name}/credential

Store authentication credentials for a catalog. These credentials are used to authenticate with R2 storage when performing catalog operations.

R2 Data Catalog

Maintenance Configs

r2_data_catalog.maintenance_configs

Methods

Get Catalog Maintenance Configuration -> Envelope<{ credential_status, maintenance_config }>
get/accounts/{account_id}/r2-catalog/{bucket_name}/maintenance-configs

Retrieve the maintenance configuration for a specific catalog, including compaction settings and credential status.

Update Catalog Maintenance Configuration -> Envelope<{ compaction, snapshot_expiration }>
post/accounts/{account_id}/r2-catalog/{bucket_name}/maintenance-configs

Update the maintenance configuration for a catalog. This allows you to enable or disable compaction and adjust target file sizes for optimization.

R2 Data Catalog

Namespaces

r2_data_catalog.namespaces

Methods

List Namespaces In Catalog -> Envelope<{ namespaces, details, namespace_uuids, 1 more... }>
get/accounts/{account_id}/r2-catalog/{bucket_name}/namespaces

Returns a list of namespaces in the specified R2 catalog. Supports hierarchical filtering and pagination for efficient traversal of large namespace hierarchies.

r2_data_catalog.namespaces.tables

Methods

List Tables In Namespace -> Envelope<{ identifiers, details, next_page_token, 1 more... }>
get/accounts/{account_id}/r2-catalog/{bucket_name}/namespaces/{namespace}/tables

Returns a list of tables in the specified namespace within an R2 catalog. Supports pagination for efficient traversal of large table collections.

r2_data_catalog.namespaces.tables.maintenance_configs

Methods

Get Table Maintenance Configuration -> Envelope<{ maintenance_config }>
get/accounts/{account_id}/r2-catalog/{bucket_name}/namespaces/{namespace}/tables/{table_name}/maintenance-configs

Retrieve the maintenance configuration for a specific table, including compaction settings.

Update Table Maintenance Configuration -> Envelope<{ compaction, snapshot_expiration }>
post/accounts/{account_id}/r2-catalog/{bucket_name}/namespaces/{namespace}/tables/{table_name}/maintenance-configs

Update the maintenance configuration for a specific table. This allows you to enable or disable compaction and adjust target file sizes for optimization.