Skip to content

Send a message

Last updated 

POST /spools/{spool}/queues/{queue}/send

Appends a message to the queue. The request body is the raw payload; Content-Length is required (411 without it) — the size is checked against the message size limit before the body is read. With a Spooler-Dedup-String (or a precomputed Spooler-Dedup-Hash), a repeat send inside the queue's dedup window appends nothing and returns 200 with the original message's id. A 500 with kind operation_unconfirmed means the append was accepted but its durability is unknown — a retry is idempotent only on a queue with a dedup window, carrying the same dedup key; without one a retry can append twice.

Sample

sh
curl -X POST "$SPOOLER_API/spools/<spool>/queues/<queue>/send" \
  -H "Authorization: Bearer $SPOOLER_KEY" \
  --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 name.
handlequerybooleannoWhen true, the response carries a signed handle to the fresh message.
Spooler-DelayheaderDuration, ≤ 168hnoHow long until the message becomes visible to receivers, at most a week (168h) — longer horizons are a scheduler's job. Omitted or 0 means immediately visible. The retention clock starts at visibility, so a delay never eats into retention.
Spooler-Dedup-Stringheaderstring, 1–128 chars, ^[\x21-\x7E]+$noAny stable key — a UUID, a ULID, or a business key like "order-12345"; 1-128 printable ASCII chars, case-sensitive, hashed server-side to the 16-byte fingerprint. A resend with the same key inside the queue's dedup window returns the original message (200) instead of enqueuing a duplicate. On a queue with no dedup window the send fails with 400 kind dedup_disabled — set the queue's dedupWindowSeconds or drop the key. Empty or repeated headers, or combining with Spooler-Dedup-Hash, fail with 400. Keys are matched by a 128-bit fingerprint; two different keys collide with probability 2⁻¹²⁸.
Spooler-Dedup-Hashheaderstring, 32 chars, ^[0-9a-fA-F]{32}$noThe 16-byte fingerprint verbatim, hex-encoded, for callers computing the fingerprint themselves. To dedup against Spooler-Dedup-String senders, compute the documented recipe: sha256(key) truncated to 16 bytes. On a queue with no dedup window the send fails with 400 kind dedup_disabled. Combining with Spooler-Dedup-String fails with 400.

Request body

Required; application/octet-stream.

Responses

StatusDescription
200Dedup hit: a message with this dedup key is already in the window; the body carries the original message's id.
201Appended 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.
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 spool holds its plan's maximum — stored messages or payload bytes, whichever bound first (kind spool_full). Backpressure, not billing: receive and ack (or delete queues) to make room, then retry.

429 headers

HeaderDescription
Retry-AfterSeconds until the next request is admitted.