UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/
https://{host}:{port}/execute/
Request
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.
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.
Whether to hide temporary domains from the response arrays.
1— Hide temporary domains fromaddon_domains,sub_domains, andparked_domainsarrays.0— Return all domains, including the temporary domains.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/DomainInfo/domains_data
- A server running cPanel.
https://cpanel-server.tld:2083/execute/DomainInfo/domains_data
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/DomainInfo/domains_data?format=hash&hide_temporary_domains=1&return_https_redirects_status=1'{ "data": { "addon_domains": [ … ] }, "errors": null, "messages": null, "metadata": null, "status": 1 }
Request
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.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/DomainInfo/list_domains
- A server running cPanel.
https://cpanel-server.tld:2083/execute/DomainInfo/list_domains
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/DomainInfo/list_domains?hide_temporary_domains=1'{ "apiversion": 3, "func": "list_domains", "module": "DomainInfo", "result": { "data": { … }, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }
Request
This function returns the built-in subdomain aliases for an account's main domain.
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.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/DomainInfo/main_domain_builtin_subdomain_aliases
- A server running cPanel.
https://cpanel-server.tld:2083/execute/DomainInfo/main_domain_builtin_subdomain_aliases
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/DomainInfo/main_domain_builtin_subdomain_aliases?hide_temporary_domains=1'{ "apiversion": 3, "func": "main_domain_builtin_subdomain_aliases", "module": "DomainInfo", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }