v1

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

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

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
  }
}