WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function sets the destination to which the system forwards a system account's email.
Notes:
- 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/set_user_email_forward_destination
- A server running WHM.
https://whm-server.tld:2087/json-api/set_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/set_user_email_forward_destination?forward_to=user&user=root'{ "metadata": { "command": "set_user_email_forward_destination", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/suspend_outgoing_email
- A server running WHM.
https://whm-server.tld:2087/json-api/suspend_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/suspend_outgoing_email?user=example'{ "metadata": { "command": "suspend_outgoing_email", "reason": "OK", "result": 1, "version": 1 } }
Request
This function terminates all IMAP and POP3 connections for a cPanel account.
Note:
This function ends connections for every email address, which includes the default address.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/terminate_cpuser_mailbox_sessions
- A server running WHM.
https://whm-server.tld:2087/json-api/terminate_cpuser_mailbox_sessions
- 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/terminate_cpuser_mailbox_sessions?username=username'{ "metadata": { "command": "terminate_cpuser_mailbox_sessions", "reason": "OK", "result": 1, "version": 1 } }