Skip to content

Peek a message

Last updated 

POST /spools/{spool}/peek

Reads the message the handle names, in whatever state it rests, without moving it: the payload as the body, its attributes as headers. A peek grants no ownership and leaves the handle valid. The handle is fenced to the message as it was minted, so one that has since been delivered, settled, recovered or discarded answers 410 — the view is stale, list again. The state reported is the current one: a delayed message reads as visible once its delay elapsed. Responses carry Cache-Control no-store.

Sample

sh
curl -X POST "$SPOOLER_API/spools/<spool>/peek" \
  -H "Authorization: Bearer $SPOOLER_KEY" \
  -H "Spooler-Handle: <handle>"

Parameters

NameInTypeRequiredDescription
spoolpathIdentName, 1–64 chars, ^[A-Za-z0-9_:-]+$yesThe spool name.
Spooler-HandleheaderHandle, 16–128 chars, ^[A-Za-z0-9_-]+$yesThe handle from a listing or a send, presented back.

Responses

StatusDescription
200The message.
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.
410The lease no longer settles anything: expired, already settled, or predates a primary change.
429The per-account request rate cap is exceeded; retry after the Retry-After delay.
503The spool is momentarily unavailable.

200 headers

HeaderDescription
Spooler-Message-IdThe message's id.
Spooler-Message-StateThe state the message rests in.
Spooler-Retry-CountRedeliveries so far.

429 headers

HeaderDescription
Retry-AfterSeconds until the next request is admitted.