cPanel/DCV
cPanel module

DCV

3 functions, invoked through the cpanel_uapi tool.

scope cpanel:uapi
Call any function with cpanel_uapi(service_id, module="DCV", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.

check_domains_via_dns POST#

Verify domain ownership via DNS

This function checks whether the account's domains can pass Domain Control Validation (DCV) via a DNS request.

No parameters.

Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:

dcv_stringstring
The expected value of the queried DNS record.
domainstring
The domain that the system verified.
failure_reasonstring
A message that contains the reason why the DCV check failed. Note: If the server fails to update the DNS zone, the system returns this value.
query_resultsarray<string>
The strings that the DNS query returned. This array may be empty. Note: If the server fails to update the DNS zone, the system returns the failure_reason value.
succeededinteger
Whether the DCV check succeeded. - 1 - At least one of the query_results values equals the dcv_string value. - 0 - None of the query_results values equal the dcv_string value.
One of: 1 0
zonestring
The altered and queried DNS zone name.

check_domains_via_http GET#

Verify domain ownership via HTTP

This function checks whether the account's domains can pass Domain Control Validation (DCV) via an HTTP request.

domainstringRequired
The domains to check. Note: To check more than one domain, repeat or increment the parameter name. For example, domain-1, domain-2, and domain-3.
dcv_file_allowed_charactersarray<any>Optional
An array of characters that the certificate provider allows in the DCV check file's filename.
dcv_file_extensionstringOptional
The DCV check file extension that the certificate provider requires.
dcv_file_random_character_countintegerOptional
The number of characters that the certificate provider allows in the DCV check file's filename.
dcv_file_relative_pathstringOptional
The DCV check file's file path, relative to the domain's document root directory.
dcv_max_redirectsintegerOptional
The number of domain redirects the system permits the DCV check to follow. The function checks the provider's supported number of redirects. It will then return the redirect array of objects for the passed value, plus one. This ensures the function will display any redirects causing DCV failures, if any exist. Note: If you pass a 0 value, this function does not limit the number of redirect returns. Use the Market::get_provider_specific_dcv_constraints UAPI function to list a provider's supported number of redirects.
dcv_user_agent_stringstringOptional
The user agent string that the system uses for the imitated local DCV check. Important: The default value can change at any time.

Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:

failure_reasonstring
The reason that the DCV check failed. * null — The domain passed the DCV check.
redirectsarray<object>
An array of objects that contains DCV check redirect information. Note: This only contains data if the redirects_count return includes a value greater than zero.
contentstring
A message that explains why the function failed.
headersobject
An object that contains the HTTP::Tiny CPAN module returns. Note: This object's contents vary according to the URL's headers.
protocolstring
The URL's HTTP protocol.
reasonstring
The HTTP response status message.
redirectsarray<any>
An array of objects containing the redirects, if the value exists.
statusinteger
successany
Whether the server returns a 2XX HTTP status code. 1 — The server returns a 2XX status code. 0 or an empty string — The server does not return a 2XX status code.
urlstring
The URL that the function searches for the DCV file.
redirects_countinteger
The number of HTTP redirects that the DCV check follows.

ensure_domains_can_pass_dcv GET#

Verify domain ownership

This function indicates whether the account's domains can pass a Domain Control Validation (DCV) check.

Warning:

We deprecated this function. Use UAPI's DCV::check_domains_via_http function.

domainstringRequired
The domains to check. Note: To check multiple domains, duplicate or increment the parameter name. For example, domain-1, domain-2, and domain-3.

Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:

A list of results from each domain parameter's DCV check. * null — The domain passes the DCV check. Note: The function returns the results from the domains in the same order in which you called them.