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
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"
        ]
      },
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}