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 -X POST "$SPOOLER_API/spools/<spool>/queues/<queue>/recv" \
  -H "Authorization: Bearer $SPOOLER_KEY"

Parameters

NameInTypeRequiredDescription
spoolpathIdentName, 1–64 chars, ^[A-Za-z0-9_:-]+$yesThe spool name.
queuepathIdentName, 1–64 chars, ^[A-Za-z0-9_:-]+$yesThe queue name.
waitqueryDuration, ≤ 20snoHow long to wait for a message before returning 204, at most 20s. Omitted or 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.
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; retry after the Retry-After delay.
503The spool is momentarily unavailable.

200 headers

HeaderDescription
Spooler-LeasePresent back to ack, nack or renew.
Spooler-Message-IdThe message's id.
Spooler-Retry-CountRedeliveries 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.