DomainInfo
Domain Information
Return cPanel account's domains
This function lists the cPanel account's domains.
Note:
For this function to succeed, the /var/cpanel/userdata/username/main file (where username represents the authenticated user) must possess the correct permissions. If a permissions error occurs, this function returns blank values for all of its returns and does not return an error message.
get/DomainInfo/list_domains
Query parameters
hide_temporary_domains1 | 0
Example:1
Whether to hide temporary domains from the response arrays.
- 1 — Hide temporary domains from the addon_domains, sub_domains, and parked_domains arrays, and from the main_domain field.
- 0 — Return all domains, including the temporary domains.
Response
HTTP Request was successful.
Example response
{
"apiversion": 3,
"func": "list_domains",
"module": "DomainInfo",
"result": {
"data": {
"addon_domains": [
"addondomain.com"
],
"main_domain": "example.com",
"parked_domains": [
"parkeddomain.com"
],
"sub_domains": [
"subdomain.example.com"
]
},
"status": 1
}
}