Skip to content
Start here

Get Custom Domain Settings

client.R2.Buckets.Domains.Custom.Get(ctx, bucketName, domain, params) (*BucketDomainCustomGetResponse, error)
GET/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain}

Get 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:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
Accepted Permissions (at least one required)
Workers R2 Storage WriteWorkers R2 Storage Read
ParametersExpand Collapse
bucketName string

Name of the bucket.

maxLength64
minLength3
domain string

Name of the custom domain.

params BucketDomainCustomGetParams
AccountID param.Field[string]

Path param: Account ID.

maxLength32
Jurisdiction param.Field[BucketDomainCustomGetParamsCfR2Jurisdiction]Optional

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

const BucketDomainCustomGetParamsCfR2JurisdictionDefault BucketDomainCustomGetParamsCfR2Jurisdiction = "default"
const BucketDomainCustomGetParamsCfR2JurisdictionEu BucketDomainCustomGetParamsCfR2Jurisdiction = "eu"
const BucketDomainCustomGetParamsCfR2JurisdictionFedramp BucketDomainCustomGetParamsCfR2Jurisdiction = "fedramp"
ReturnsExpand Collapse
type BucketDomainCustomGetResponse struct{…}
Domain string

Domain name of the custom domain to be added.

Enabled bool

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

Status BucketDomainCustomGetResponseStatus
Ownership BucketDomainCustomGetResponseStatusOwnership

Ownership status of the domain.

One of the following:
const BucketDomainCustomGetResponseStatusOwnershipPending BucketDomainCustomGetResponseStatusOwnership = "pending"
const BucketDomainCustomGetResponseStatusOwnershipActive BucketDomainCustomGetResponseStatusOwnership = "active"
const BucketDomainCustomGetResponseStatusOwnershipDeactivated BucketDomainCustomGetResponseStatusOwnership = "deactivated"
const BucketDomainCustomGetResponseStatusOwnershipBlocked BucketDomainCustomGetResponseStatusOwnership = "blocked"
const BucketDomainCustomGetResponseStatusOwnershipError BucketDomainCustomGetResponseStatusOwnership = "error"
const BucketDomainCustomGetResponseStatusOwnershipUnknown BucketDomainCustomGetResponseStatusOwnership = "unknown"
SSL BucketDomainCustomGetResponseStatusSSL

SSL certificate status.

One of the following:
const BucketDomainCustomGetResponseStatusSSLInitializing BucketDomainCustomGetResponseStatusSSL = "initializing"
const BucketDomainCustomGetResponseStatusSSLPending BucketDomainCustomGetResponseStatusSSL = "pending"
const BucketDomainCustomGetResponseStatusSSLActive BucketDomainCustomGetResponseStatusSSL = "active"
const BucketDomainCustomGetResponseStatusSSLDeactivated BucketDomainCustomGetResponseStatusSSL = "deactivated"
const BucketDomainCustomGetResponseStatusSSLError BucketDomainCustomGetResponseStatusSSL = "error"
const BucketDomainCustomGetResponseStatusSSLUnknown BucketDomainCustomGetResponseStatusSSL = "unknown"
Ciphers []stringOptional

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

MinTLS BucketDomainCustomGetResponseMinTLSOptional

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

One of the following:
const BucketDomainCustomGetResponseMinTLS1_0 BucketDomainCustomGetResponseMinTLS = "1.0"
const BucketDomainCustomGetResponseMinTLS1_1 BucketDomainCustomGetResponseMinTLS = "1.1"
const BucketDomainCustomGetResponseMinTLS1_2 BucketDomainCustomGetResponseMinTLS = "1.2"
const BucketDomainCustomGetResponseMinTLS1_3 BucketDomainCustomGetResponseMinTLS = "1.3"
ZoneID stringOptional

Zone ID of the custom domain resides in.

ZoneName stringOptional

Zone that the custom domain resides in.

Get Custom Domain Settings

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/r2"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  custom, err := client.R2.Buckets.Domains.Custom.Get(
    context.TODO(),
    "example-bucket",
    "example-domain/custom-domain.com",
    r2.BucketDomainCustomGetParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", custom.Domain)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "result": {
    "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"
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "result": {
    "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"
  },
  "success": true
}