DomainLookup

Return a domain's document root

This function retrieves the document root for a single domain on the cPanel account.

Note:

If the domain does not exist on the account, the system returns the account's public_html directory rather than an error.

get/DomainLookup/getdocroot

Request

  • Base URL
    https://cpanel-server.tld:2083/execute
  • Auth
    HTTP basic

Query parameters

domainstring domain
Example:example.com

The domain to look up. The system converts this value to lowercase.

Omit this parameter to retrieve the document root for the account's primary domain.

Response

HTTP Request was successful.

errorsstring[] nullable
messagesstring[] nullable
status0 | 1
  • 1 — Success.
  • 0 — Failed. Check the errors field for more details.
warningsstring[] nullable

Example response

{
  "data": [
    {
      "docroot": "/home/username/public_html",
      "reldocroot": "public_html"
    }
  ],
  "status": 1
}

Changes

No recorded changes to this operation across all 5 revisions of this API.