Update DCV API
Call this API when the user wants to change the domain validation method or switch the DCV scope.
Endpoint
POST /api/v1/certificate/update-dcv
Host:
...
Full URL
/api/v1/certificate/update-dcv
Request
Content-Type: application/json
Content-Length: 165
{
"service_id": "o91bZ", // Certificate ID, the `service_id` returned by the Create Certificate Order API
"domain_dcv": { // Domain + validation info, optional (can be omitted when only switching the scope), each domain maps to one validation type
"*.example.com": "dns", //⚠️Note: wildcards only support dns or email validation
"example2.com": "http", //⚠️Note: for http/https subdomain file validation, the file must be uploaded to the subdomain itself; passing the base domain or another domain is not supported
"example3.com": "https",
"sub.example4.com": "admin@example4.com" // ⚠️Note: email validation does not support whois emails; only admin@, administrator@, postmaster@, webmaster@, hostmaster@ + <subdomain or base domain> combinations are supported
},
"dcv_scope": "base_domain" // DCV validation scope, optional, supports base_domain (base domain) or apply_domain (subdomain/applied domain), only supported by some products, see "DCV Validation Scope" below
}
The domain keys in domain_dcv (and domain in the single-domain form) accept both punycode and the original Unicode form; for example, xn--fiqs8s and its Unicode original are equivalent — either one works.
Please note: domains in the API response are always returned in punycode. Please match against punycode.
dcv_scope controls whether the DNS validation host record is added under the base domain (root domain) or under the applied subdomain (full FQDN). Only AutoCert and Keymatic brand products are supported; switching the scope for other brands returns a 400 error.
- Possible values:
base_domain: base domain scope; the validation record is added under the root domain (e.g. when applying fora.b.example.com, the DNS record is resolved at_dnsauth.example.com).apply_domain: subdomain scope (applied domain scope); the validation record is added directly under the specific subdomain being applied for (e.g. when applying fora.b.example.com, the DNS record is resolved at_dnsauth.a.b.example.com). The aliasfqdnis also accepted.
- Supported call forms:
- Change both the validation method and the scope: pass both
domain_dcvanddcv_scope; - Switch the scope only: pass only
service_idanddcv_scope; there is no need to passdomain_dcvagain; - Single-domain form: pass
service_id,domain,type, anddcv_scope.
- Change both the validation method and the scope: pass both
- Scope switching behavior:
- During first issuance: the old order is automatically refunded and cancelled at the CA, then a new order is placed with the new scope and the latest domains;
- During reissue review: the old reissue request is automatically cancelled, then a new reissue is initiated with the new scope and the latest domains and CSR.
- Switching constraints:
- Only when the domain validation method is DNS: if the current validation method is HTTP, HTTPS, or Email, the API rejects the switch with an error (400);
- Only before the certificate is issued: switching the scope is allowed only while the certificate is not yet issued (first issuance awaiting validation, or reissue awaiting validation); if the certificate has already been issued, the API rejects the switch with an error (400).
Response
- response
- errors
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 36
{
"success": true,
"message": "OK"
}
HTTP/1.1 404 Not Found
Content-Type: application/json
Content-Length: 50
{
"success": false,
"message": "Unable to find this order"
}
Do not call this API before the user has completed the DNS record setup or file validation. Because DNS results are cached, a failed CA lookup is usually cached for several minutes, during which your (or your customers') certificates will not be issued.
The correct approach is: after the user completes the setup, provide a "Check DNS record" / "Check file content" button on your platform that synchronously calls this API. With this integration, orders under your API are usually issued within 1 minute after the user completes the setup, delivering a better customer experience.