Return all domains' hosting configuration

This function lists user data for the cPanel account's domains.

Note:

This function retrieves data from the /var/cpanel/userdata/user/domain file, where user represents the cPanel account username and domain represents the domain. For this reason, actual output may not contain all of the returns that this document lists.

SecurityBasicAuth
Request
query Parameters
format
string
Default: "hash"

The function's return format.

  • hash — Use a hash format. The function will return objects based on the domain type.
  • list — Use a list format. The function will return an array of objects, where each object is a domain.
Enum: "hash" "list"
Example: format=hash
return_https_redirects_status
integer
Default: 0

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

  • 1 — Return the status.
  • 0 — Do not return the status.
Enum: 1 0
Example: return_https_redirects_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/domains_data
Request samples
uapi --output=jsonpretty \
  --user=username \
  DomainInfo \
  domains_data
Response samples
application/json
{
  • "data": {
    • "addon_domains": [
      • {
        • "all_aliases_valid": "0",
        • "can_https_redirect": "0",
        • "documentroot": "/home/user/public_html/seconddomain.com",
        • "domain": "seconddomain.com",
        • "group": "user",
        • "hascgi": "1",
        • "homedir": "/home/user",
        • "ip": "192.168.0.128",
        • "ipv6": null,
        • "is_https_redirecting": "0",
        • "no_cache_update": "0",
        • "owner": "root",
        • "serveradmin": "webmaster@seconddomain.example.com",
        • "serveralias": "seconddomain.com www.seconddomain.com www.seconddomain.example.com",
        • "servername": "seconddomain.example.com",
        • "type": "addon_domain",
        • "usecanonicalname": "Off",
        • "user": "user",
        • "userdirprotect": ""
        },
      • {
        • "all_aliases_valid": "0",
        • "can_https_redirect": "0",
        • "documentroot": "/home/user/public_html/subdomain",
        • "domain": "exampledomain.com",
        • "group": "user",
        • "hascgi": "1",
        • "homedir": "/home/user",
        • "ip": "192.168.0.128",
        • "ipv6": null,
        • "is_https_redirecting": "0",
        • "no_cache_update": "0",
        • "owner": "root",
        • "serveradmin": "webmaster@subdomain.example.com",
        • "serveralias": "exampledomain.com www.exampledomain.com www.subdomain.example.com",
        • "servername": "subdomain.example.com",
        • "type": "addon_domain",
        • "usecanonicalname": "Off",
        • "user": "user",
        • "userdirprotect": ""
        },
      • {
        • "all_aliases_valid": "0",
        • "can_https_redirect": "0",
        • "documentroot": "/home/user/addondomain/home/dir",
        • "domain": "addondomain.com",
        • "group": "user",
        • "hascgi": "1",
        • "homedir": "/home/user",
        • "ip": "192.168.0.128",
        • "ipv6": null,
        • "is_https_redirecting": "0",
        • "main_domain": {
          • "all_aliases_valid": "0",
          • "can_https_redirect": "0",
          • "customlog": [
            • {
              • "format": "combined",
              • "target": "/usr/local/apache/domlogs/example.com"
              },
            • {
              • "format": "\"%{%s}t %I .\\n%{%s}t %O .\"",
              • "target": "/usr/local/apache/domlogs/example.com-bytes_log"
              }
            ],
          • "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",
          • "port": "80",
          • "scriptalias": [
            • {
              • "path": "/home/user/public_html/cgi-bin",
              • "url": "/cgi-bin/"
              },
            • {
              • "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": ""
          },
        • "no_cache_update": "0",
        • "owner": "root",
        • "parked_capable_of_https_redirects": [
          • "parkeddomain.com"
          ],
        • "parked_domains": [
          • "parkeddomain.com"
          ],
        • "parked_with_https_redirects": [
          • "parkeddomain.com"
          ],
        • "serveradmin": "webmaster@subdomain.example.com",
        • "serveralias": "addondomain.com www.addondomain.com www.subdomain.example.com",
        • "servername": "subdomain.example.com",
        • "sub_domains": [
          • {
            • "all_aliases_valid": "0",
            • "can_https_redirect": "0",
            • "documentroot": "/home/user/public_html/sub",
            • "domain": "sub.example.com",
            • "group": "user",
            • "hascgi": "1",
            • "homedir": "/home/user",
            • "ip": "192.168.0.128",
            • "ipv6": null,
            • "is_https_redirecting": "0",
            • "no_cache_update": "0",
            • "owner": "root",
            • "serveradmin": "webmaster@sub.example.com",
            • "serveralias": "www.sub.example.com",
            • "servername": "sub.example.com",
            • "type": "sub_domain",
            • "usecanonicalname": "Off",
            • "user": "user",
            • "userdirprotect": ""
            }
          ],
        • "type": "addon_domain",
        • "usecanonicalname": "Off",
        • "user": "user",
        • "userdirprotect": ""
        }
      ]
    },
  • "errors": null,
  • "messages": null,
  • "metadata": null,
  • "status": 1
}