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 disables ModSecurity™ on specified domains.
Important:
When you disable the WebServer role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/ModSecurity/disable_domains
- A server running cPanel.
https://cpanel-server.tld:2083/execute/ModSecurity/disable_domains
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
uapi --output=jsonpretty \
--user=username \
ModSecurity \
disable_domains \
domains='example.com,dallas.example.com,galveston.example.com'{ "apiversion": 3, "func": "disable_domains", "module": "ModSecurity", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
Request
This function enables ModSecurity™ on a cPanel account's domains.
Important:
When you disable the WebServer role, the system disables this function
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/ModSecurity/enable_all_domains
- A server running cPanel.
https://cpanel-server.tld:2083/execute/ModSecurity/enable_all_domains
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
uapi --output=jsonpretty \
--user=username \
ModSecurity \
enable_all_domains{ "apiversion": 3, "func": "enable_all_domains", "module": "ModSecurity", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
Request
This function enables ModSecurity™ for specified domains.
Important:
When you disable the WebServer role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/ModSecurity/enable_domains
- A server running cPanel.
https://cpanel-server.tld:2083/execute/ModSecurity/enable_domains
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
uapi --output=jsonpretty \
--user=username \
ModSecurity \
enable_domains \
domains='example.com,dallas.example.com,galveston.example.com'{ "apiversion": 3, "func": "enable_domains", "module": "ModSecurity", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }