Appearance
Errors
Error responses are JSON:
json
{
"kind": "queue_not_found",
"message": "queue orders does not exist",
"details": {"queue": "orders"}
}kind is present where the status alone is ambiguous; details carries the facts the message states, as fields fixed per kind, and is absent for kinds that have none. Match on the status, kind and details; the message text is for humans and is not part of the contract. A fact never lives only in message: what a client can act on is a field, in the body or in a header. A fact HTTP has a header for is that header and is not repeated in the body: the wait on a 429 is Retry-After, whole seconds.
A status without a kind means what HTTP says: 503 the spool is momentarily unavailable – retry.
Kinds
Where a kind carries details, its shape follows the meaning – the shape, not a sample: values are the wire types.
| Kind | Status | Retry | Meaning |
|---|---|---|---|
invalid_token | 400 | Never. | The token – lease or handle – is malformed: a bug or tampering. |
dedup_disabled | 400 | No – set dedupWindowSeconds or drop the key. | The send carries a dedup key but the queue has no dedup window. |
unknown_header | 400 | No – fix the request. | A Spooler-* request header the operation does not define – likely meant for another endpoint. jsonc |
unauthenticated | 401 | No – fix the credentials. | The API key is missing, malformed or not recognized. |
account_suspended | 402 | After settling payment. | The account is suspended for an unpaid balance; paying lifts it. |
account_blocked | 403 | No – contact support. | The account is on an abuse hold; paying does not lift it. |
retention_limit | 403 | No. | The requested retention exceeds the plan's limit. jsonc |
queue_limit | 403 | No – delete unused queues. | The plan's queue limit is reached. jsonc |
queue_not_found | 404 | No. | The queue does not exist. A verdict, not lag. jsonc |
spool_not_found | 404 | No. | No spool of that name on the account. A verdict, like queue_not_found; a spool just created is visible within seconds. |
queue_exists | 409 | No. | A create names a queue that already exists. |
queue_creating | 409 | Yes; the retry answers queue_exists, or creates the queue if the earlier create failed. | Another create of the name has not completed; until it does, the queue does not exist and reads answer queue_not_found. |
queue_deleting | 409 | A create: yes, once the deletion completes. Otherwise no. | The queue refuses the operation while its deletion completes; until then it holds its name, so a create under the name is refused too. |
queue_busy | 409 | Yes. | Another change to the queue, an update or a delete, has not completed. |
not_failed | 409 | No – a verdict; the view was fresh. | Recover was given a current handle to a message that is not failed. |
dedup_in_flight | 409 | Yes, after it settles. | A send with the same dedup key has not settled yet. |
dedup_claimed | 409 | No – ack explicitly if folding into it was the intent. | An ack-and-send's dedup key is held by another message; nothing was acked. jsonc |
stale_token | 410 | A lease: receive again. A handle: list again. | The token verified but no longer names anything: the lease expired, was settled, or predates a primary change; the message a handle named moved on. |
queue_replaced | 412 | No – a verdict; read the queue again for its current uid. | An update or delete given a uid found another queue under the name, created again since. Nothing was changed. jsonc |
payload_too_large | 413 | No. | The message exceeds the plan's size limit (see limits); the connection is closed. |
rate_limited | 429 | After the Retry-After seconds. | The per-account request rate cap is exceeded (see request rate). |
operation_unconfirmed | 500 | A send: only on a queue with a dedup window, carrying the same key (see deduplication). | The write was accepted but its durability is unknown. |
spool_full | 507 | After making room. | The spool holds its plan's maximum stored messages or payload bytes (see limits). jsonc |
Retrying a change
Every operation that changes state – a send, an ack-and-send, a receive, a renew, the settles, a recover, a discard, and a queue create, update or delete – answers in two classes:
- Changed nothing. Every
4xx,503and507: each is answered before the change is attempted, so retrying one repeats nothing. Most are verdicts; the transient ones are409queue_creating,queue_busyanddedup_in_flight,429and503. Such a status speaks for this attempt only: it says nothing about an earlier attempt whose response was lost. - May have changed. A
500of any kind, a502or504, or no response at all.operation_unconfirmedsays so explicitly: the entry was written but its durability is unknown. Any other500is not proven to precede the change. A502or504means the gateway lost the node serving the spool and cannot tell one that was unreachable from one that went away after committing; a dropped connection or a client timeout is the same from the client's side.
What a retry in the second class does depends on the operation:
- A send can append twice. A retry is safe only on a queue with a dedup window, carrying the key the first attempt carried, while the window still remembers it: within the window's duration, with the window unchanged in between. See deduplication.
- An ack-and-send or a settle that committed answers
410and changes nothing. A410on the retry does not prove the first attempt succeeded: the lease may instead have expired or become stale. - A receive is a second receive: it may lease a different message, while the first delivery stays leased until its lease times out and it is redelivered – or, on a queue with no lease timeout, until a primary change drops it.
- A renew renews the lease from the moment of the retry; repeating it is safe.
- A create that committed answers
409queue_exists. - An update applies the same settings again, to whatever queue has that name when the retry arrives. Give it the queue's
uidand a retry cannot reach a queue created under the name since: it answers412queue_replacedand changes nothing. - A delete deletes whatever queue has that name when the retry arrives, including one created after the first delete committed. Give it the queue's
uidand a retry cannot: once the first delete committed, the retry answers404queue_not_found, or412queue_replacedif a queue was created under the name since, and changes nothing.
Operations that change nothing – reading a queue, its stats, a listing, an inspect – are safe to retry.