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 date of the search window. This parameter defaults to the current time.
Note
This parameter is an alias for endtime and is provided for backwards compatibility.
The end time of the search window. This parameter defaults to the current time.
Note
You can also call this the enddate parameter.
Whether to return the TOTALSIZE parameter.
- 1 — Do not return.
- 0 — Return.
Whether to return the SUCCESSCOUNT parameter.
- 1 — Do not return.
- 0 — Return.
The start date of the search window.
Note
This parameter is an alias for starttime and is provided for backwards compatibility.
The start time of the search window.
Note
You can also call this the startdate parameter.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/emailtrack_stats
- A server running WHM.
https://whm-server.tld:2087/json-api/emailtrack_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_stats?deliverytype=remote&enddate=1471552781&endtime=1471552781&nosize=0&nosuccess=0&startdate=1371552781&starttime=1371552781&user=username'{ "data": { "records": [ … ] }, "metadata": { "command": "emailtrack_stats", "reason": "OK", "result": 1, "version": 1 } }
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 } }