Custom Hostname Details
custom_hostnames.get(strcustom_hostname_id, CustomHostnameGetParams**kwargs) -> CustomHostnameGetResponse
GET/zones/{zone_id}/custom_hostnames/{custom_hostname_id}
Retrieves detailed information about a specific custom hostname, including SSL certificate status, ownership verification, and origin configuration.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Parameters
Custom Hostname Details
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_hostname = client.custom_hostnames.get(
custom_hostname_id="0d89c70d-ad9f-4843-b99f-6cc0252067e9",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
print(custom_hostname.id){
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
"string"
],
"success": true,
"result": {
"id": "0d89c70d-ad9f-4843-b99f-6cc0252067e9",
"hostname": "app.example.com",
"created_at": "2020-02-06T18:11:23.531995Z",
"custom_metadata": {
"foo": "string"
},
"custom_origin_server": "origin2.example.com",
"custom_origin_sni": "sni.example.com",
"ownership_verification": {
"name": "_cf-custom-hostname.app.example.com",
"type": "txt",
"value": "5cc07c04-ea62-4a5a-95f0-419334a875a4"
},
"ownership_verification_http": {
"http_body": "5cc07c04-ea62-4a5a-95f0-419334a875a4",
"http_url": "http://custom.test.com/.well-known/cf-custom-hostname-challenge/0d89c70d-ad9f-4843-b99f-6cc0252067e9"
},
"ssl": {
"id": "0d89c70d-ad9f-4843-b99f-6cc0252067e9",
"bundle_method": "ubiquitous",
"certificate_authority": "google",
"custom_csr_id": "7b163417-1d2b-4c84-a38a-2fb7a0cd7752",
"dcv_delegation_records": [
{
"cname": "_acme-challenge.example.com",
"cname_target": "dcv.cloudflare.com",
"emails": [
"administrator@example.com",
"webmaster@example.com"
],
"http_body": "ca3-574923932a82475cb8592200f1a2a23d",
"http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt",
"status": "pending",
"txt_name": "_acme-challenge.app.example.com",
"txt_value": "810b7d5f01154524b961ba0cd578acc2"
}
],
"expires_on": "2021-02-06T18:11:23.531995Z",
"hosts": [
"app.example.com",
"*.app.example.com"
],
"issuer": "DigiCertInc",
"method": "http",
"serial_number": "6743787633689793699141714808227354901",
"settings": {
"ciphers": [
"ECDHE-RSA-AES128-GCM-SHA256",
"AES128-SHA"
],
"early_hints": "on",
"http2": "on",
"min_tls_version": "1.2",
"tls_1_3": "on"
},
"signature": "SHA256WithRSA",
"status": "pending_validation",
"type": "dv",
"uploaded_on": "2020-02-06T18:11:23.531995Z",
"validation_errors": [
{
"message": "SERVFAIL looking up CAA for app.example.com"
}
],
"validation_records": [
{
"cname": "_acme-challenge.example.com",
"cname_target": "dcv.cloudflare.com",
"emails": [
"administrator@example.com",
"webmaster@example.com"
],
"http_body": "ca3-574923932a82475cb8592200f1a2a23d",
"http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt",
"status": "pending",
"txt_name": "_acme-challenge.app.example.com",
"txt_value": "810b7d5f01154524b961ba0cd578acc2"
}
],
"wildcard": false
},
"status": "pending",
"verification_errors": [
"None of the A or AAAA records are owned by this account and the pre-generated ownership verification token was not found."
]
}
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
"string"
],
"success": true,
"result": {
"id": "0d89c70d-ad9f-4843-b99f-6cc0252067e9",
"hostname": "app.example.com",
"created_at": "2020-02-06T18:11:23.531995Z",
"custom_metadata": {
"foo": "string"
},
"custom_origin_server": "origin2.example.com",
"custom_origin_sni": "sni.example.com",
"ownership_verification": {
"name": "_cf-custom-hostname.app.example.com",
"type": "txt",
"value": "5cc07c04-ea62-4a5a-95f0-419334a875a4"
},
"ownership_verification_http": {
"http_body": "5cc07c04-ea62-4a5a-95f0-419334a875a4",
"http_url": "http://custom.test.com/.well-known/cf-custom-hostname-challenge/0d89c70d-ad9f-4843-b99f-6cc0252067e9"
},
"ssl": {
"id": "0d89c70d-ad9f-4843-b99f-6cc0252067e9",
"bundle_method": "ubiquitous",
"certificate_authority": "google",
"custom_csr_id": "7b163417-1d2b-4c84-a38a-2fb7a0cd7752",
"dcv_delegation_records": [
{
"cname": "_acme-challenge.example.com",
"cname_target": "dcv.cloudflare.com",
"emails": [
"administrator@example.com",
"webmaster@example.com"
],
"http_body": "ca3-574923932a82475cb8592200f1a2a23d",
"http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt",
"status": "pending",
"txt_name": "_acme-challenge.app.example.com",
"txt_value": "810b7d5f01154524b961ba0cd578acc2"
}
],
"expires_on": "2021-02-06T18:11:23.531995Z",
"hosts": [
"app.example.com",
"*.app.example.com"
],
"issuer": "DigiCertInc",
"method": "http",
"serial_number": "6743787633689793699141714808227354901",
"settings": {
"ciphers": [
"ECDHE-RSA-AES128-GCM-SHA256",
"AES128-SHA"
],
"early_hints": "on",
"http2": "on",
"min_tls_version": "1.2",
"tls_1_3": "on"
},
"signature": "SHA256WithRSA",
"status": "pending_validation",
"type": "dv",
"uploaded_on": "2020-02-06T18:11:23.531995Z",
"validation_errors": [
{
"message": "SERVFAIL looking up CAA for app.example.com"
}
],
"validation_records": [
{
"cname": "_acme-challenge.example.com",
"cname_target": "dcv.cloudflare.com",
"emails": [
"administrator@example.com",
"webmaster@example.com"
],
"http_body": "ca3-574923932a82475cb8592200f1a2a23d",
"http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt",
"status": "pending",
"txt_name": "_acme-challenge.app.example.com",
"txt_value": "810b7d5f01154524b961ba0cd578acc2"
}
],
"wildcard": false
},
"status": "pending",
"verification_errors": [
"None of the A or AAAA records are owned by this account and the pre-generated ownership verification token was not found."
]
}
}