Delete selected messages in mailbox

This function marks the selected mail messages as deleted.

Authorizations:
query Parameters
required
string or string

The email account's name.

Examples:
account=_mainaccount@example.com
account=example
account=user@example.com
mailbox
required
string

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.
Example: mailbox=INBOX.user@example_com
query
required
string

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.

Example: query=savedbefore 52w

Responses

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object

Request samples

uapi --user=username Mailboxes expunge_mailbox_messages account='_mainaccount@example.com' mailbox='INBOX.user@example_com' query='savedbefore 52w'

Response samples

Content type
application/json
{
  • "apiversion": 3,
  • "func": "expunge_mailbox_messages",
  • "module": "Mailboxes",
  • "result": {
    • "data": null,
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}