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/
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/DomainInfo/primary_domain
- A server running cPanel.
https://cpanel-server.tld:2083/execute/DomainInfo/primary_domain
- 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/primary_domain?hide_temporary_domains=1'{ "apiversion": 3, "func": "primary_domain", "module": "DomainInfo", "result": { "data": { … }, "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
Request
This function lists user data for a domain.
Important:
This function retrieves data from the /var/cpanel/userdata/user/domain file, where user represents the cPanel account username and domain represents the domain.
- Because aliases (parked domains) do not use a user data file, this function cannot query information for aliases. To retrieve information for an alias, specify the associated main or addon domain.
- Due to differences in user data files, the function's actual output may not contain all of the returns that this document lists.
The domain on the cPanel account.
Important:
Do not specify an alias (parked domain).
Whether to hide temporary domains from the returned values.
1— Return an error if the requested domain is a temporary domain.0— Return all domains, including the temporary domains.
Note:
If you set this parameter's value to 1 and the requested domain is temporary, the function will return an error similar to the following example: Domain [example.com] is a temporary domain and hide_temporary_domains is enabled.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/DomainInfo/single_domain_data
- A server running cPanel.
https://cpanel-server.tld:2083/execute/DomainInfo/single_domain_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/single_domain_data?domain=example.com&hide_temporary_domains=1&return_https_redirect_status=1'{ "apiversion": 3, "func": "single_domain_data", "module": "DomainInfo", "result": { "data": { … }, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }