Get your free beta license ↗
API operation · mail group
POST

/mail/queue/delete

First published 14 Oct 20260.2.0Unchanged since publication

Delete queued messages by queue ID or sender

Who may call it
AdministratorResellerCustomer
Token scope, any of
mailall
Answers200 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 server

Request body

JSON· 2 fields
idsarray of string, matching ^[A-F0-9]{6,20}$
Sender 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 sentence
400--id, --all or --sender is required
400A queue id is 6 to 20 uppercase hexadecimal characters
400At most 1000 messages are removed in one call
400Domain name required
400Domain name too long
400Give ids or a sender, not both
400Invalid domain name
400Invalid mail address
400Invalid mail address: local part over 64 characters
400Invalid mail address: no local part
400Invalid mail address: the local part may hold letters, digits, dots, _ + and -
400No queue id was given
400The mail stack is not installed on this server
400ids must be a list of queue ids
401Authentication required
403A reseller removes queued messages by sender
404No mailbox <sender> here
404No such user: <owner>
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/