WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
The type of delivery to query. If you do not specify a value, this function returns all types.
remoteremote-or-faildeferlocal
The end time of the search window.
The sender's email address. If you do not specify a value, this function returns entries for mail from all senders.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/emailtrack_user_stats
- A server running WHM.
https://whm-server.tld:2087/json-api/emailtrack_user_stats
- 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/emailtrack_user_stats?deliverytype=remote&endtime=1471552781&sender=username%40example.com&starttime=1371552781'{ "data": { "records": [ … ] }, "metadata": { "command": "emailtrack_user_stats", "reason": "OK", "result": 1, "version": 1 } }
Request
This function removes mail messages from a cPanel account that you select with a query.
Important:
When you disable the Receive Mail role, the system disables this function.
An email account that exists on the server.
A mailbox name on the account.
Note:
Because you cannot escape wildcard characters such as (*), we recommend that you use functions that use the mailbox_guid parameter instead. For example, the WHM API 1 expunge_messages_for_mailbox_guid function.
A Dovecot search query to select which messages you wish to remove from the mailbox.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/expunge_mailbox_messages
- A server running WHM.
https://whm-server.tld:2087/json-api/expunge_mailbox_messages
- 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/expunge_mailbox_messages?account=user%40example.com&mailbox=INBOX&query=savedbefore+52w'{ "metadata": { "command": "expunge_mailbox_messages", "reason": "OK", "result": 1, "version": 1 } }
Request
This function removes mail messages from a cPanel account.
Important:
When you disable the Receive Mail role, the system disables this function.
The mailbox's globally unique identifier (GUID).
Note:
To find the mailbox GUID, use the WHM API 1 - get_mailbox_status function.
The Dovecot search query to select which messages you wish to remove from the mailbox. For more information, read Dovecot's Search Query documentation.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/expunge_messages_for_mailbox_guid
- A server running WHM.
https://whm-server.tld:2087/json-api/expunge_messages_for_mailbox_guid
- 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/expunge_messages_for_mailbox_guid?account=user%40example.com&mailbox_guid=2550860f0c58d158c92a000044f0d230&query=savedbefore+52w'{ "metadata": { "command": "expunge_messages_for_mailbox_guid", "reason": "OK", "result": 1, "version": 1 } }