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.

SecurityBasicAuth
Request
query Parameters
hide_temporary_domains
integer
Default: 0

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.
Enum: 1 0
Example: hide_temporary_domains=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/list_domains
Request samples
uapi --output=jsonpretty \
  --user=username \
  DomainInfo \
  list_domains
Response samples
application/json
{
  • "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"
        ],
      • "is_temporary": {
        • "property1": 0,
        • "property2": 0
        }
      },
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}