Skip to content

Renew a lease

Last updated 

POST /spools/{spool}/renew

Resets the lease expiry to now plus the lease's queue's current lease timeout — a reset, not an extension: after a settings update the new expiry can land earlier than the previous one, or go away. On a queue with no lease timeout the lease never expires and Spooler-Lease-Expires-At is absent, even for a lease granted with a deadline before the timeout was removed. A message discarded by handle while leased makes the renew answer 410 stale_token, like any settle: renewing on a schedule is how a long-running worker learns its task was cancelled.

Sample ​

sh
curl -si -X POST "$SPOOLER_API/spools/<spool>/renew" \
  -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
204Renewed.
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.
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.
503The spool is momentarily unavailable.

204 headers ​

HeaderDescription
Spooler-Lease-Expires-AtThe new absolute expiry (RFC 3339, UTC). Absent when the queue has no lease timeout: the lease never expires.

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.