Skip to content

Fail a message

Last updated 

POST /spools/{spool}/fail

Fails the message now, without waiting for its retries to run out — for a message the consumer can tell is poison. The message stays intact for the listing, inspect, recover and discard.

Sample ​

sh
curl -X POST "$SPOOLER_API/spools/<spool>/fail" \
  -H "Authorization: Bearer $SPOOLER_KEY" \
  -H "Spooler-Lease: <lease>"

Parameters ​

NameInTypeRequiredDescription
spoolpathIdentName, 1–63 chars, ^[A-Za-z0-9_:-]+$yesThe spool name.
Spooler-LeaseheaderLease, 16–256 chars, ^[A-Za-z0-9_-]+$yesThe lease from a receive, presented back.

Responses ​

StatusDescription
204Failed.
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.
409Concurrent state refuses the operation; the kind names it.
410The lease no longer settles anything: expired, already settled, or predates a primary change.
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.
500The server failed; kind operation_unconfirmed means the write was accepted but its durability is unknown.
503The spool is momentarily unavailable.

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.