# DELETE /mail/queue/{id}

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the mail group.

Delete a message from the Postfix queue

- Who may call it: administrator
- Token scope, any of: mail, all
- Answers: 200 OK

Deletes the queued message without notifying the sender. The 200 response returns the queue ID in id and the deletion result in deleted.

The id must contain 6 to 20 uppercase hexadecimal characters. An invalid id returns 400. Requires an administrator token with the mail scope.

## As a command

- [urbestack-mail-queue-del](https://urbestack.com/docs/commands/urbestack-mail-queue-del.md): Deletes selected messages from the Postfix queue or empties it with --all.

## Parameters

- `id` (path, string, matching ^[A-F0-9]{6,20}$, required)

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X DELETE "$API/mail/queue/1" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "deleted": 1,
  "id": 1
}
```

## Errors

- 400: --id, --all or --sender is required
- 400: A queue id is 6 to 20 uppercase hexadecimal characters
- 400: At most 1000 messages are removed in one call
- 400: Domain name required
- 400: Domain name too long
- 400: Invalid domain name
- 400: Invalid mail address
- 400: Invalid mail address: local part over 64 characters
- 400: Invalid mail address: no local part
- 400: Invalid mail address: the local part may hold letters, digits, dots, _ + and -
- 400: No queue id was given
- 400: The mail stack is not installed on this server
- 401: Authentication required
- 404: No mailbox <sender> here
- 404: No such user: <owner>
