WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function retrieves the destination to which the system forwards a system account's email.
Note:
- Usually, the system sends notices about the server's problems and activity to the
rootaccount. - If you do not use the
suexecmodule, thenobodyuser receives bounce messages from email that CGI scripts send.
Important:
When you disable the Receive Mail role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/get_user_email_forward_destination
- A server running WHM.
https://whm-server.tld:2087/json-api/get_user_email_forward_destination
- 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_user_email_forward_destination?user=root'{ "data": { "forward_to": [ … ] }, "metadata": { "command": "get_user_email_forward_destination", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/hold_outgoing_email
- A server running WHM.
https://whm-server.tld:2087/json-api/hold_outgoing_email
- 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/hold_outgoing_email?user=example'{ "metadata": { "command": "hold_outgoing_email", "reason": "OK", "result": 1, "version": 1 } }
Request
This function lists a cPanel account’s email accounts. To prevent falsified data or symlink exploitation, the function uses the specified cPanel account user, rather than root user, to read data from the user’s home directory. The system compares the collected data from the user’s home directory to a server-wide domains list. The comparison of the data validates whether you can trust the data.
Important:
When you disable the Receive Mail role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/list_pops_for
- A server running WHM.
https://whm-server.tld:2087/json-api/list_pops_for
- 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/list_pops_for?user=example'{ "data": { "pops": [ … ] }, "metadata": { "command": "list_pops_for", "reason": "OK", "result": 1, "version": 1 } }