WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function retrieves the current user's Access Control List (ACL) privileges.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/myprivs
- A server running WHM.
https://whm-server.tld:2087/json-api/myprivs
- 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/whm.openapi/myprivs{ "data": { "privileges": [ … ] }, "metadata": { "command": "myprivs", "reason": "OK", "result": 1, "version": 1 } }
Request
This function retrieves the data from an NVData file on disk. cPanel NVData is a per-account configuration storage mechanism that you can use to maintain persistent cPanel & WHM settings across multiple sessions. This includes custom settings for your own themes.
Note:
You can only call this function as a JSON request. For more information about additional output options, run the whmapi1 --help command.
A list of NVData keys stored on the server.
Note:
If you did not set a value for the requested keys, the system returns a null value.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/personalization_get
- A server running WHM.
https://whm-server.tld:2087/json-api/personalization_get
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/personalization_get \
-H 'Content-Type: application/json' \
-d '{
"names": [
"milk",
"coffee"
],
"store": "beverages"
}'{ "data": { "personalization": { … } }, "metadata": { "command": "personalization_get", "reason": "OK", "result": 1, "version": 1 } }
Request
This function is used to save personalization data for a WHM user to a datastore on disk.
We call this system cPanel NVData.
cPanel NVData is a per-login configuration storage mechanism that you can use to maintain persistent user interface settings across multiple sessions.
This includes custom settings for your own themes and plugins.
This function is used to save personalzation data for WHM users only. If you want to save personalization data for cPanel users, use the UAPI function personalization_set.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/personalization_set
- A server running WHM.
https://whm-server.tld:2087/json-api/personalization_set
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/personalization_set \
-H 'Content-Type: application/json' \
-d '{
"api.version": 1,
"personalization": {
"coffee": "hot",
"milk": "cold"
},
"store": "beverages"
}'{ "data": { "personalization": { … } }, "metadata": { "command": "personalization_set", "reason": "OK", "result": 1, "version": 1 } }