Configure Custom Domain Settings
r2.buckets.domains.custom.update(strdomain, CustomUpdateParams**kwargs) -> CustomUpdateResponse
PUT/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain}
Edit the configuration for a custom domain on an existing R2 bucket.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
Configure Custom Domain Settings
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
)
custom = client.r2.buckets.domains.custom.update(
domain="example-domain/custom-domain.com",
account_id="023e105f4ecef8ad9ca31a8372d0c353",
bucket_name="example-bucket",
)
print(custom.domain){
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
"string"
],
"result": {
"domain": "example-domain.com",
"ciphers": [
"string"
],
"enabled": true,
"minTLS": "1.0"
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
"string"
],
"result": {
"domain": "example-domain.com",
"ciphers": [
"string"
],
"enabled": true,
"minTLS": "1.0"
},
"success": true
}