v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
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

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
}