List namespaces in catalog
Returns a list of namespaces in the specified R2 catalog. Supports hierarchical filtering and pagination for efficient traversal of large namespace hierarchies.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Accepted Permissions (at least one required)
Parameters
Maximum number of namespaces to return per page. Defaults to 100, maximum 1000.
Opaque pagination token from a previous response. Use this to fetch the next page of results.
Parent namespace to filter by. Only returns direct children of this namespace. For nested namespaces, use %1F as separator (e.g., "bronze%1Fanalytics"). Omit this parameter to list top-level namespaces.
Whether to include additional metadata (timestamps). When true, response includes created_at and updated_at arrays.
List namespaces in catalog
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
)
namespaces = client.r2_data_catalog.namespaces.list(
bucket_name="my-data-bucket",
account_id="0123456789abcdef0123456789abcdef",
)
print(namespaces.namespace_uuids){
"errors": [
{
"code": 0,
"message": "message"
}
],
"messages": [
{
"code": 0,
"message": "message"
}
],
"success": true,
"result": {
"namespaces": [
[
"bronze",
"analytics"
]
],
"details": [
{
"namespace": [
"bronze",
"analytics"
],
"namespace_uuid": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"created_at": "2019-12-27T18:11:19.117Z",
"updated_at": "2019-12-27T18:11:19.117Z"
}
],
"namespace_uuids": [
"0199b999-6869-7383-bb1f-d30e059d5326",
"0199b99b-2c88-73b3-8dbb-421e0e8f2757"
],
"next_page_token": "MSYxNzU5NzU1NTc4NTA0MTk0JjAxOTliOTliLTJjODgtNzNiMy04ZGJiLTQyMWUwZThmMjc1Nw"
}
}Returns Examples
{
"errors": [
{
"code": 0,
"message": "message"
}
],
"messages": [
{
"code": 0,
"message": "message"
}
],
"success": true,
"result": {
"namespaces": [
[
"bronze",
"analytics"
]
],
"details": [
{
"namespace": [
"bronze",
"analytics"
],
"namespace_uuid": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"created_at": "2019-12-27T18:11:19.117Z",
"updated_at": "2019-12-27T18:11:19.117Z"
}
],
"namespace_uuids": [
"0199b999-6869-7383-bb1f-d30e059d5326",
"0199b99b-2c88-73b3-8dbb-421e0e8f2757"
],
"next_page_token": "MSYxNzU5NzU1NTc4NTA0MTk0JjAxOTliOTliLTJjODgtNzNiMy04ZGJiLTQyMWUwZThmMjc1Nw"
}
}