WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function retrieves values from the /var/cpanel/cpanel.config file and the server's Exim configuration.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/get_tweaksetting
- A server running WHM.
https://whm-server.tld:2087/json-api/get_tweaksetting
- 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/get_tweaksetting?key=defaultmailaction&module=Main'{ "data": { "tweaksetting": { … } }, "metadata": { "command": "get_tweaksetting", "reason": "OK", "result": 1, "version": 1 } }
The feature(s) for which to return configuration keys.
Note:
- Pass multiple
itemparameters to return multiple features' configuration keys. - If an
itemparameter returns anundefinedkey value, the configuration value does not exist or is set tonull.
Return the key1 configuration key for the cpanel feature.
Return the nested key3.subkey1 configuration key for the webmail feature.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/leika_get_config
- A server running WHM.
https://whm-server.tld:2087/json-api/leika_get_config
- 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/leika_get_config?item=string'{ "data": { "cpanel.key1": "enabled", "webmail.key3": "JSON object" }, "metadata": { "command": "leika_get_config", "reason": "OK", "result": 1, "version": 1 } }
Request
This function sets an option's value in WHM's Tweak Settings interface (WHM >> Home >> Server Configuration >> Tweak Settings). The system stores the keys and values that this function updates in the /var/cpanel/cpanel.config file.
The cpanel.config setting name that corresponds to the desired setting in WHM's Tweak Settings interface (WHM >>Home >> Server Configuration >> Tweak Settings).
The value to assign to the setting. If you include this parameter in the call but do not set a value, the value defaults to an empty value.
Note:
For more information about the requirements for values in the cpanel.config file settings, read our cpanel.config file documentation.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/set_tweaksetting
- A server running WHM.
https://whm-server.tld:2087/json-api/set_tweaksetting
- 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/set_tweaksetting?key=proxysubdomains&module=Main&value=0'{ "metadata": { "command": "set_tweaksetting", "reason": "OK", "result": 1, "version": 1 } }