Skip to content

List messages

Last updated 

GET /spools/{spool}/queues/{queue}/messages

One page of the queue's messages as they are now, in send order, every state or one. Each entry describes a message without its payload; with handle=true it also carries a handle to the message's current delivery generation, which inspect, recover and discard present back — a handle to a message that has since been delivered, settled, recovered or discarded answers 410, so a stale listing costs a fresh one and never an action on a delivery someone else took. A delayed message becoming visible keeps its handle. Ids identify and never act: no operation takes one. Responses carry Cache-Control no-store.

Sample ​

sh
curl -X GET "$SPOOLER_API/spools/<spool>/queues/<queue>/messages" \
  -H "Authorization: Bearer $SPOOLER_KEY"

Parameters ​

NameInTypeRequiredDescription
spoolpathIdentName, 1–63 chars, ^[A-Za-z0-9_:-]+$yesThe spool name.
queuepathIdentName, 1–63 chars, ^[A-Za-z0-9_:-]+$yesThe queue name.
statequerydelayed / visible / pending / failed / unavailablenoKeep only messages in this state; absent keeps every state.
limitqueryinteger, 1–1,000, default 100noMax messages per page.
afterqueryCursor, 1–256 charsnoResume the listing just past this cursor (the previous page's next); absent starts at the first message.
handlequerybooleannoWhen true, every entry carries a handle. Off by default, since a handle is a bearer credential.

Responses ​

StatusDescription
200One page of messages.
400The request is malformed; the kind names the problem.
401The API key is missing or not recognized; the kind is unauthenticated.
402The account is suspended; the kind is account_suspended.
403The operation is refused; the kind names why: a plan limit (queue_limit, retention_limit), or account_blocked on any operation when the account is on an abuse hold.
404The spool or queue does not exist; the kind says which.
429The per-account request rate cap is exceeded. The body names the kind (rate_limited); the wait is the Retry-After header and is not repeated in the body. Headers are as structured as the body, and this one is the header HTTP defines for a wait.
503The spool is momentarily unavailable.

200 headers ​

HeaderDescription
Cache-ControlAlways no-store.

200 body shape ​

The shape, not a sample: values are the wire types; ? marks an optional field.

jsonc
{
  // One page of the queue's messages, in send order.
  items: [
    {
      // The message's id.
      id: string,

      // The state the message is in.
      state: "delayed" | "visible" | "pending" | "failed" | "unavailable",

      // Redeliveries so far.
      retries: integer,

      // When the message was sent (RFC 3339, UTC).
      createdAt: string,

      // When a delayed message becomes visible; present only in the
      // delayed state.
      visibleAt?: string,

      // When the current lease expires; present only in the pending state
      // on a queue with a lease timeout.
      leaseExpiresAt?: string,

      // When retention discards the message; absent when retention is
      // off.
      expiresAt?: string,

      // A handle to the message's current delivery generation; present
      // only when the listing asked for it via handle=true.
      //
      // Length:  16–256 chars
      // Pattern: ^[A-Za-z0-9_-]+$
      handle?: string,
    }
  ],

  // Cursor of the following page (pass as after); absent when this page
  // ends the listing.
  //
  // Length: 1–256 chars
  next?: string,
}

429 headers ​

HeaderDescription
Retry-AfterSeconds until the next request is admitted, whole and at least 1; always the delay-seconds form, never an HTTP-date.