Create Custom Hostname response does not match the documentation

When sending a post request to the create endpoint it seems like the validation cert is not being returned in the response for the post hostname api. I would expect response.data.ssl.validation_records https://developers.cloudflare.com/api/operations/custom-hostname-for-a-zone-create-custom-hostname But the response is:
result: {
id: '85efa926-8179-4c81-926e-eced6009ad63',
hostname: 'test.exampleDomain.com',
ssl: {
id: 'de9b5334-8757-4b5f-85a9-5bcf3a4f0919',
type: 'dv',
method: 'txt',
status: 'initializing',
settings: [Object],
wildcard: false,
certificate_authority: 'google'
},
status: 'pending',
ownership_verification: {
type: 'txt',
name: '_cf-custom-hostname.test.exampleDomain.com',
value: '7bd6536e-dc3d-46ba-974a-9e608090a3aa'
},
ownership_verification_http: {
http_url: 'http://test.exampleDomain.com/.well-known/cf-custom-hostname-challenge/85efa926-8179-4c81-926e-eced6009ad63',
http_body: '7bd6536e-dc3d-46ba-974a-9e608090a3aa'
},
created_at: '2024-01-31T19:55:43.182431Z'
},
success: true,
errors: [],
messages: []
}
result: {
id: '85efa926-8179-4c81-926e-eced6009ad63',
hostname: 'test.exampleDomain.com',
ssl: {
id: 'de9b5334-8757-4b5f-85a9-5bcf3a4f0919',
type: 'dv',
method: 'txt',
status: 'initializing',
settings: [Object],
wildcard: false,
certificate_authority: 'google'
},
status: 'pending',
ownership_verification: {
type: 'txt',
name: '_cf-custom-hostname.test.exampleDomain.com',
value: '7bd6536e-dc3d-46ba-974a-9e608090a3aa'
},
ownership_verification_http: {
http_url: 'http://test.exampleDomain.com/.well-known/cf-custom-hostname-challenge/85efa926-8179-4c81-926e-eced6009ad63',
http_body: '7bd6536e-dc3d-46ba-974a-9e608090a3aa'
},
created_at: '2024-01-31T19:55:43.182431Z'
},
success: true,
errors: [],
messages: []
}
Cloudflare API Documentation
Interact with Cloudflare's products and services via the Cloudflare API
2 Replies
Chaika
Chaika5mo ago
it needs more time to initialize, is that what you're confused about? if you wait a bit and get the details of the custom hostname after, it should contain everything. CF needs to reach out to the cert authority and get those details I see what you mean though, it does kind of imply it would be returned on the response, although in the actual response breakdown it properly shows it's not required/won't always be returned. There's a feedback button on the bottom left of the api docs. It looks like all the custom hostnames api docs use that example full response containing all possible properties. You don't have to request ssl at all in a new custom hostname and that could be entirely null, they could still maybe improve it so clearly say those fields are optional/won't be there for the inital create
tony
tony4mo ago
Thank you!
Want results from more Discord servers?
Add your server
More Posts