Return domain's hosting configuration

This function lists user data for a domain.

Important:

This function retrieves data from the /var/cpanel/userdata/user/domain file, where user represents the cPanel account username and domain represents the domain.

  • Because aliases (parked domains) do not use a user data file, this function cannot query information for aliases. To retrieve information for an alias, specify the associated main or addon domain.
  • Due to differences in user data files, the function's actual output may not contain all of the returns that this document lists.
SecurityBasicAuth
Request
query Parameters
domain
required
string <domain>

The domain on the cPanel account.

Important:

Do not specify an alias (parked domain).

Example: domain=example.com
return_https_redirect_status
integer
Default: 0

Whether to return the secure redirect status of the addon domains.

  • 1 - Return status.
  • 0 - Do not return status.
Enum: 0 1
Example: return_https_redirect_status=1
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/DomainInfo/single_domain_data
Request samples
uapi --output=jsonpretty \
  --user=username \
  DomainInfo \
  single_domain_data \
  domain='example.com'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "single_domain_data",
  • "module": "DomainInfo",
  • "result": {
    • "data": {
      • "all_aliases_valid": 0,
      • "can_https_redirect": 0,
      • "customlog": {
        • "domain": "combined",
        • "target": "/usr/local/apache/domlogs/example.com"
        },
      • "documentroot": "/home/user/public_html/",
      • "domain": "example.com",
      • "group": "user",
      • "hascgi": 1,
      • "homedir": "/home/user",
      • "ifmodulemodsuphpc": {
        • "group": "user"
        },
      • "ip": "192.168.0.128",
      • "is_https_redirecting": 0,
      • "options": "ExecCGI Includes",
      • "owner": "root",
      • "phpopenbasedirprotect": 1,
      • "port": 80,
      • "scriptalias": {
        • "path": "/home/user/public_html/cgi-bin",
        • "url": "/cgi-bin/"
        },
      • "serveradmin": "webmaster@example.com",
      • "serveralias": "parkeddomain.com www.parkeddomain.com www.example.com",
      • "servername": "example.com",
      • "type": "main_domain",
      • "usecanonicalname": "Off",
      • "user": "user",
      • "userdirprotect": 1
      },
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}