Skip to content

Acknowledge a message and send another

Last updated 

POST /spools/{spool}/queues/{queue}/ack-and-send

Atomically completes the delivery the lease names and appends the request body to the path's queue — a pipeline step handing its result to the next stage, with no window where the input is acked and the output is missing, or the reverse. The two queues may differ or be the same. Send's headers apply: Spooler-Delay postpones the new message, a dedup key deduplicates it. Retries need no dedup key: a retry of a committed call fails with 410 and appends nothing, and a redelivery after a lost lease means the first call never committed. A dedup hit refuses the whole call (409 kind dedup_claimed, the original id in the body) and acks nothing — ack explicitly if folding into the existing message was the intent. The spool's message cap does not apply (the call is net zero); the byte cap refuses only growth past the limit.

Sample

sh
curl -X POST "$SPOOLER_API/spools/<spool>/queues/<queue>/ack-and-send" \
  -H "Authorization: Bearer $SPOOLER_KEY" \
  -H "Spooler-Lease: <lease>" \
  --data-binary '<payload>'

Parameters

NameInTypeRequiredDescription
spoolpathIdentName, 1–64 chars, ^[A-Za-z0-9_:-]+$yesThe spool name.
queuepathIdentName, 1–64 chars, ^[A-Za-z0-9_:-]+$yesThe queue the new message is sent to.
handlequerybooleannoWhen true, the response carries a signed handle to the fresh message.
Spooler-LeaseheaderLeaseToken, 16–128 chars, ^[A-Za-z0-9_-]+$yesThe lease from a receive, presented back.
Spooler-DelayheaderDuration, ≤ 168hnoHow long until the new message becomes visible, at most a week (168h). Omitted or 0 means immediately visible.
Spooler-Dedup-Stringheaderstring, 1–128 chars, ^[\x21-\x7E]+$noThe new message's dedup key, as on send. A hit inside the queue's dedup window refuses the whole call with 409.
Spooler-Dedup-Hashheaderstring, 32 chars, ^[0-9a-fA-F]{32}$noThe new message's 16-byte dedup fingerprint, hex-encoded, as on send.

Request body

Required; application/octet-stream.

Responses

StatusDescription
201Acknowledged and appended durably.
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.
410The lease no longer settles anything: expired, already settled, or predates a primary change.
411The request has no Content-Length.
413The message exceeds the size limit.
429The per-account request rate cap is exceeded; retry after the Retry-After delay.
500The server failed; kind operation_unconfirmed means the write was accepted but its durability is unknown.
503The spool is momentarily unavailable.
507The new message would grow the spool's payload bytes past its plan's maximum (kind spool_full). An equal or smaller message always passes, so a full spool can still drain.

429 headers

HeaderDescription
Retry-AfterSeconds until the next request is admitted.