API operation · mail group
POST
/mail/queue/delete
First published 14 Oct 2026
0.2.0Unchanged since publicationDelete queued messages by queue ID or sender
Who may call it
AdministratorResellerCustomer
Token scope, any of
mailallAnswers200 OK
Administrators can supply either ids or sender. UrbeStack deletes the messages selected by queue ID in one batch. Selection by sender deletes every queued message from that sender email address. UrbeStack sends no deletion notifications to senders.
Resellers must supply sender on one of their own domains or one of their customers' domains. A reseller request without a sender returns 403. The API returns 400 if both fields are supplied or if an administrator's request by queue ID lacks a nonempty ids list of queue IDs with 6 to 20 uppercase hexadecimal characters each.
The response includes ids and deleted. When the request selects by sender, the response also includes sender.
As a command
Run as root on the serverRequest body
JSON· 2 fieldsidsarray of string, matching ^[A-F0-9]{6,20}$senderMailAddressSender email address whose queued messages are all selected for deletion.
Example
See the API overview for how to set $API and $TOKEN.Request
curl -sS -X POST "$API/mail/queue/delete" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"text"
],
"sender": "text"
}'Response ·
200 OK{
"deleted": 1,
"ids": [
"text"
],
"sender": "text"
}Errors
18 errors, each a status and a sentence400--id, --all or --sender is required400A queue id is 6 to 20 uppercase hexadecimal characters400At most 1000 messages are removed in one call400Domain name required400Domain name too long400Give ids or a sender, not both400Invalid domain name400Invalid mail address400Invalid mail address: local part over 64 characters400Invalid mail address: no local part400Invalid mail address: the local part may hold letters, digits, dots, _ + and -400No queue id was given400The mail stack is not installed on this server400ids must be a list of queue ids401Authentication required403A reseller removes queued messages by sender404No mailbox <sender> here404No such user: <owner>No error of this operation matches.
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.2.0 on 14 Oct 2026.
urbestack.com/docs/api/post-mail-queue-delete/