Skip to content

Peek the oldest failed message

Last updated 

GET /spools/{spool}/queues/{queue}/failures/head

Reads the head of the failure queue without consuming it: repeated reads return the same message until it is recovered or discarded. The Spooler-Lease header carries the lease that recover and discard present back. Responses carry Cache-Control no-store.

Sample

sh
curl -X GET "$SPOOLER_API/spools/<spool>/queues/<queue>/failures/head" \
  -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.

Responses

StatusDescription
200The oldest failed message.
204The failure queue is empty.
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.
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 recover or discard.
Spooler-Message-IdThe message's id.
Spooler-Retry-CountRedeliveries before the message failed.

429 headers

HeaderDescription
Retry-AfterSeconds until the next request is admitted.