Cambiar el método de validación SSL

Sirve para cambiar el método de validación SSL entre HTTP y TXT; usá TXT cuando el CNAME todavía no apunta y la validación por HTTP no puede completarse.

POST
/custom-domains/{customDomain}/switch-validation

Switch a domain's SSL Domain Control Validation (DCV) method between HTTP (default) and TXT (fallback, design.md D11)

Escritura · requiere el permiso accounts:write.

This is the escape hatch for domains whose CNAME does not yet route to Cloudflare: HTTP DCV cannot complete without traffic reaching the origin, but TXT DCV validates purely from a DNS record. Scoped to the authenticated admin via findOwned() (404 if not owned). Calls patchSsl() with the NEW method (a "switch", as opposed to verify()'s same-method "re-trigger") and persists it. When switching TO TXT, the ssl_validation_string is captured best-effort from the response — Cloudflare frequently has not yet populated ssl.validation_records at PATCH time (confirmed against a live Cloudflare response: it is filled in asynchronously, a few seconds later). When the PATCH response comes back empty, a best-effort follow-up get() is issued immediately to try to capture it right away — this covers the common case where the value is already available a moment later, so the customer sees the TXT record without having to wait for a subsequent verify()/sweep. The follow-up is best-effort: if it also comes back empty, or Cloudflare fails/is unreachable for it, the switch still succeeds and a later verify()/sweep captures the value once available (bug fix: the TXT dns_record was never shown to the user when the PATCH raced Cloudflare's population of ssl.validation_records).

Autorización

http
headerAuthorizationBearer <clave>

Parámetros de la ruta

customDomain*integer

Cuerpo del pedido

application/json
  1. body

Validates the payload for POST /custom-domains/{customDomain}/switch-validation (design.md D11): switches a domain's SSL Domain Control Validation (DCV) method between HTTP (default) and TXT (fallback for domains whose CNAME does not yet route to Cloudflare).

Authorization (admin-only, payment-valid) is enforced at the route-group level (can:user-admin + can:payment-valid); ownership of the target domain is enforced by the controller's findOwned() (404 if not the authenticated admin's own domain) — same pattern as verify/destroy.

method*SslValidationMethod

SSL Domain Control Validation (DCV) method requested from Cloudflare for SaaS when creating or re-validating a Custom Hostname. HTTP is the default requested by CloudflareCustomHostnameClient::create() (design.md D9 — supersedes the original TXT-only MVP default): the certificate is issued once the CNAME resolves and traffic reaches Cloudflare, with no DNS TXT record required for the common case. TXT remains available as an explicit fallback via the switch-validation endpoint (design.md D11) for domains whose CNAME does not yet route to Cloudflare.

Valor en"TXT""HTTP"

Cuerpo de la respuesta

CustomDomainResource

application/json
  1. response
curl -X POST "https://example.com/custom-domains/0/switch-validation" \  -H "Content-Type: application/json" \  -d '{    "method": "TXT"  }'
{}