Skip to content

Receive a message

Last updated 

POST /spools/{spool}/queues/{queue}/recv

Leases a visible message. wait long-polls until a message becomes visible or the wait elapses (204). The payload returns raw; the lease and message attributes ride Spooler-* response headers. Responses carry Cache-Control no-store. A draining queue keeps serving receives until its backlog empties.

Sample ​

sh
curl -si -X POST "$SPOOLER_API/spools/<spool>/queues/<queue>/recv" \
  -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.
waitSecondsqueryinteger, 0–20noSeconds to wait for a message before returning 204, at most 20. Absent waits the maximum; 0 returns immediately.

Responses ​

StatusDescription
200A message was leased.
204No message became visible within the wait window.
400The request is malformed; the kind names the problem.
401The API key is missing or not recognized.
402The account is suspended.
403A plan limit refuses the operation; the kind names it. A 403 without a kind, on any operation, means the API key is blocked.
404The spool or queue does not exist; the kind says which.
409Concurrent state refuses the operation; the kind names it.
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
Spooler-LeasePresent back to ack, nack or renew.
Spooler-Message-IdThe message's id.
Spooler-Message-RetriesRedeliveries so far; 0 on the first delivery.
Spooler-Lease-Expires-AtWhen the lease auto-nacks (RFC 3339, UTC). Absent when the queue has no lease timeout.

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.