Skip to content
Start here

List Custom Domains of Bucket

r2.buckets.domains.custom.list(strbucket_name, CustomListParams**kwargs) -> CustomListResponse
GET/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom

Gets a list of all custom domains registered with an existing R2 bucket.

Security

API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
ParametersExpand Collapse
account_id: str

Account ID.

maxLength32
bucket_name: str

Name of the bucket.

maxLength64
minLength3
jurisdiction: Optional[Literal["default", "eu", "fedramp"]]

Jurisdiction where objects in this bucket are guaranteed to be stored.

One of the following:
"default"
"eu"
"fedramp"
ReturnsExpand Collapse
class CustomListResponse:
domains: List[Domain]
domain: str

Domain name of the custom domain to be added.

enabled: bool

Whether this bucket is publicly accessible at the specified custom domain.

status: DomainStatus
ownership: Literal["pending", "active", "deactivated", 3 more]

Ownership status of the domain.

One of the following:
"pending"
"active"
"deactivated"
"blocked"
"error"
"unknown"
ssl: Literal["initializing", "pending", "active", 3 more]

SSL certificate status.

One of the following:
"initializing"
"pending"
"active"
"deactivated"
"error"
"unknown"
ciphers: Optional[List[str]]

An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.

min_tls: Optional[Literal["1.0", "1.1", "1.2", "1.3"]]

Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0.

One of the following:
"1.0"
"1.1"
"1.2"
"1.3"
zone_id: Optional[str]

Zone ID of the custom domain resides in.

zone_name: Optional[str]

Zone that the custom domain resides in.

List Custom Domains of Bucket

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
customs = client.r2.buckets.domains.custom.list(
    bucket_name="example-bucket",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
print(customs.domains)
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "result": {
    "domains": [
      {
        "domain": "prefix.example-domain.one.com",
        "enabled": false,
        "status": {
          "ownership": "deactivated",
          "ssl": "pending"
        },
        "ciphers": [
          "string"
        ],
        "minTLS": "1.0",
        "zoneId": "36ca64a6d92827b8a6b90be344bb1bfd",
        "zoneName": "example-domain.one.com"
      },
      {
        "domain": "prefix.example-domain.two.com",
        "enabled": true,
        "status": {
          "ownership": "active",
          "ssl": "active"
        },
        "ciphers": [
          "string"
        ],
        "minTLS": "1.0",
        "zoneId": "d9d28585d5f8f5b0f857b055bf574f19",
        "zoneName": "zoneName"
      }
    ]
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "result": {
    "domains": [
      {
        "domain": "prefix.example-domain.one.com",
        "enabled": false,
        "status": {
          "ownership": "deactivated",
          "ssl": "pending"
        },
        "ciphers": [
          "string"
        ],
        "minTLS": "1.0",
        "zoneId": "36ca64a6d92827b8a6b90be344bb1bfd",
        "zoneName": "example-domain.one.com"
      },
      {
        "domain": "prefix.example-domain.two.com",
        "enabled": true,
        "status": {
          "ownership": "active",
          "ssl": "active"
        },
        "ciphers": [
          "string"
        ],
        "minTLS": "1.0",
        "zoneId": "d9d28585d5f8f5b0f857b055bf574f19",
        "zoneName": "zoneName"
      }
    ]
  },
  "success": true
}