v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
Mailboxes
Mailbox Management

Delete selected messages in mailbox

This function marks the selected mail messages as deleted.

get/Mailboxes/expunge_mailbox_messages

Query parameters

string email required
OR
string username required

The email account's name.

mailboxstring required
Example:INBOX.user@example_com

The mailbox to operate on.

Note:

  • Use the Mailboxes::get_mailbox_status_list function to list possible values for the mailbox parameter.
  • Because you cannot escape wildcard characters such as (*), we recommend that you use functions that use the mailbox_guid parameter instead. For example, the Mailboxes::expunge_messages_for_mailbox_guid function.
querystring required
Example:savedbefore 52w

The Dovecot query to execute.

Note:

The query parameter prevents accidental removal of all messages in the mailbox. For more information, read Dovecot's Search Query documentation.

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "expunge_mailbox_messages",
  "module": "Mailboxes",
  "result": {
    "status": 1
  }
}