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

/mail/queue/{id}/deliver

First published 14 Oct 20260.2.0Unchanged since publication

Request immediate delivery of a queued message

Who may call it
AdministratorResellerCustomer
Token scope, any of
mailall
Answers200 OK

UrbeStack asks Postfix to attempt delivery immediately. With trace=true, UrbeStack temporarily adds the next-hop hosts to Postfix's debug_peer_list and reloads Postfix. The next hops are the sender domain's smarthost, the server's smarthost, or the MX hosts for each recipient domain. UrbeStack removes the temporary entries regardless of the outcome.

The traced request follows the attempt in the mail log for up to wait seconds. Its delivery object includes every SMTP command and reply captured and each recipient's status line. Poll GET /mail/queue/{id}/deliver to read the trace while the request is in progress.

The API returns 400 if id falls outside the required format of 6 to 20 uppercase hexadecimal characters or wait falls outside the allowed whole-number range.

As a command

Run as root on the server

Parameters

idpath ·string, matching ^[A-F0-9]{6,20}$Required

Request body

JSON· 2 fields
traceboolean
Whether to follow the delivery attempt in the mail log and return its SMTP conversation and per-recipient status lines. The default is false, which requests delivery without tracing it.
waitinteger, 1 to 300
Maximum number of seconds to follow a traced attempt, from 0 to 300. If omitted, UrbeStack uses mail_deliver_wait, which defaults to 60 seconds.

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X POST "$API/mail/queue/1/deliver" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "trace": true,
    "wait": 1
  }'
Response · 200 OK
{
  "delivery": {
    "before": {
      "attempt_count": 1,
      "attempts": [
        {
          "at": "text",
          "delay": 1,
          "dsn": "text",
          "relay": "text",
          "reply": "text",
          "status": "active",
          "to": "text"
        }
      ],
      "hops": [
        "text"
      ],
      "last_at": "text",
      "last_reply": "text",
      "last_status": "text",
      "log_lines": [
        "text"
      ],
      "message": {
        "arrival_time": 1,
        "forced_expire": 1,
        "id": 1,
        "queue": "text",
        "recipients": [
          {
            "address": "info@example.com",
            "delay_reason": "text"
          }
        ],
        "sender": "text",
        "size": 1
      },
      "next_hop": "text",
      "read_at": "text",
      "subject": "text",
      "subjects_logged": true
    },
    "delivering": true,
    "done": true,
    "hops": [
      "text"
    ],
    "id": 1,
    "lines": [
      {
        "at": "text",
        "dir": "out",
        "pid": 1,
        "text": "text"
      }
    ],
    "noise": 1,
    "read_at": "text",
    "results": [
      {
        "at": "text",
        "delay": 1,
        "dsn": "text",
        "relay": "text",
        "reply": "text",
        "status": "active",
        "to": "text"
      }
    ],
    "running": true,
    "traced": true,
    "wait": 1,
    "waited": 1
  }
}

Errors

6 errors, each a status and a sentence
400--id is required
400<what> must be a whole number from 0 to <max>
400A queue id is 6 to 20 uppercase hexadecimal characters
400Invalid boolean
400The mail stack is not installed on this server
401Authentication required
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-id-deliver/