doc: custom hostname PATCH requires type+method when changing CA#28489
doc: custom hostname PATCH requires type+method when changing CA#28489dmmulroy wants to merge 7 commits intocloudflare:productionfrom
Conversation
|
I think if we can just document at a high level that there are essentially two flavors of custom hostname SSL objects. "Managed" and "Custom". Managed means Cloudflare handles the lifecycle of the certificate (order / validation / renewal). Custom means a customer comes with a private key and certificate already. When it's a managed custom hostname, two fields are always required in the PATCH
When it's custom, the requirements on the ssl object differ in the PATCH
|
|
/bonk review and suggest any fixes for style or code issues |
There was a problem hiding this comment.
Good PR — this fills a real documentation gap that was causing customer-facing errors. The two-flavor (managed vs. custom certificate) structure that @mitch292 suggested has been incorporated well. A few suggestions below, mostly around consistency and reducing duplication.
Summary
- The content is technically sound and well-organized.
- Heading hierarchy, component imports, link format, and style are all correct.
- Main feedback: curl URL quoting should be consistent with existing examples, and the duplicated examples in
issue-certificates.mdxcould be replaced with a cross-reference to reduce maintenance surface.
...loudflare-for-saas/security/certificate-management/issue-and-validate/issue-certificates.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/cloudflare-for-platforms/cloudflare-for-saas/start/common-api-calls.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/cloudflare-for-platforms/cloudflare-for-saas/start/common-api-calls.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/cloudflare-for-platforms/cloudflare-for-saas/start/common-api-calls.mdx
Outdated
Show resolved
Hide resolved
| ## Change certificate authority | ||
|
|
||
| To change the CA for an existing managed custom hostname, use the [Edit Custom Hostname](/api/resources/custom_hostnames/methods/edit/) PATCH endpoint. You must include `ssl.type` and `ssl.method` alongside `ssl.certificate_authority` — these fields are always required when [editing a managed hostname's SSL settings](/cloudflare-for-platforms/cloudflare-for-saas/start/common-api-calls/#managed-certificates). | ||
|
|
||
| This triggers certificate re-issuance with the new CA. | ||
|
|
||
| <Details header="Switch to Google Trust Services"> | ||
|
|
||
| ```sh | ||
| curl --request PATCH \ | ||
| https://api.cloudflare.com/client/v4/zones/{zone_id}/custom_hostnames/{custom_hostname_id} \ | ||
| --header "X-Auth-Email: <EMAIL>" \ | ||
| --header "X-Auth-Key: <API_KEY>" \ | ||
| --header "Content-Type: application/json" \ | ||
| --data '{ | ||
| "ssl": { | ||
| "type": "dv", | ||
| "method": "http", | ||
| "certificate_authority": "google" | ||
| } | ||
| }' | ||
| ``` | ||
|
|
||
| </Details> | ||
|
|
||
| <Details header="Reset to default CA"> | ||
|
|
||
| To let Cloudflare choose the best CA, set `certificate_authority` to an empty string: | ||
|
|
||
| ```sh | ||
| curl --request PATCH \ | ||
| https://api.cloudflare.com/client/v4/zones/{zone_id}/custom_hostnames/{custom_hostname_id} \ | ||
| --header "X-Auth-Email: <EMAIL>" \ | ||
| --header "X-Auth-Key: <API_KEY>" \ | ||
| --header "Content-Type: application/json" \ | ||
| --data '{ | ||
| "ssl": { | ||
| "type": "dv", | ||
| "method": "http", | ||
| "certificate_authority": "" | ||
| } | ||
| }' | ||
| ``` | ||
|
|
||
| </Details> | ||
|
|
||
| Valid `certificate_authority` values: `"google"` (Google Trust Services), `"lets_encrypt"` (Let's Encrypt), `"ssl_com"` (SSL.com), or `""` (empty string for default CA). |
There was a problem hiding this comment.
Consider replacing this entire section (the two Details blocks and the valid-values line) with a shorter cross-reference to common-api-calls.mdx, which now contains the authoritative examples. For example:
## Change certificate authority
To change the CA for an existing managed custom hostname, use the [Edit Custom Hostname](/api/resources/custom_hostnames/methods/edit/) PATCH endpoint. You must include `ssl.type` and `ssl.method` alongside `ssl.certificate_authority` — these fields are always required when editing a managed hostname's SSL settings.
This triggers certificate re-issuance with the new CA. For required fields, valid values, and curl examples, refer to [Edit custom hostname SSL](/cloudflare-for-platforms/cloudflare-for-saas/start/common-api-calls/#managed-certificates).
Duplicating the full curl examples across two pages creates a maintenance burden — if the API changes, both pages need updating.
...loudflare-for-saas/security/certificate-management/issue-and-validate/issue-certificates.mdx
Outdated
Show resolved
Hide resolved
|
Review posted successfully. Here's a summary of what I flagged: Overall: The PR is well-structured and addresses a real documentation gap. The managed vs. custom certificate split (per @mitch292's feedback) is cleanly implemented. MDX syntax, component imports, heading hierarchy, link format, and style are all correct. Suggestions posted (6 inline comments):
|
…security/certificate-management/issue-and-validate/issue-certificates.mdx Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
…start/common-api-calls.mdx Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
…start/common-api-calls.mdx Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
…start/common-api-calls.mdx Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
…security/certificate-management/issue-and-validate/issue-certificates.mdx Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
Summary
ssl.typeandssl.methodare required when using PATCH to changessl.certificate_authorityon an existing custom hostname — omitting them silently fails or returns error 1434Changes
common-api-calls.mdx### Change certificate authoritysubsection with valid values, method info, and two collapsible curl examples (switch to Google, reset to default)issue-certificates.mdx## Change certificate authoritysection between existing "Certificate authorities" and "Certificate details" sectionstype/methodvaluestroubleshooting.mdx## Certificate authority change not taking effect via APItroubleshooting entry with example and valid CA valuesContext
The PATCH
/zones/{zone_id}/custom_hostnames/{id}endpoint requiresssl.type("dv") andssl.method("http"/"txt") when changingssl.certificate_authority, but this wasn't documented. The API reference markstypeandmethodas optional, which is misleading for this use case. Customers (notably beehiiv) hit error 1434 (ErrValidationTypeMethodRequired) when sending onlycertificate_authority.