Skip to content

Delete a queue

Last updated 

DELETE /spools/{spool}/queues/{queue}

Deletes the queue. In force mode the queue and every message in it are deleted right away; the call returns once the deletion is durable and the name is free for reuse. In drain mode the queue stops accepting new messages, remains consumable until the backlog is drained, and is then deleted; the call returns 202 as soon as the drain intent is durable. Deletion survives restarts either way. The mode is required: deleting a non-empty queue is destructive in force mode, so the choice is always explicit.

Sample

sh
curl -X DELETE "$SPOOLER_API/spools/<spool>/queues/<queue>?mode=<mode>" \
  -H "Authorization: Bearer $SPOOLER_KEY"

Parameters

NameInTypeRequiredDescription
spoolpathIdentName, 1–64 chars, ^[A-Za-z0-9_:-]+$yesThe spool name.
queuepathIdentName, 1–64 chars, ^[A-Za-z0-9_:-]+$yesThe queue name.
modequeryforce / drainyesforce deletes the queue and every message in it right away; drain refuses new messages, lets consumers empty the backlog, and deletes the queue when it is drained.

Responses

StatusDescription
202Deletion is durable and in progress: the drain was accepted, or an immediate deletion did not finish within the request window. The queue refuses the affected operations already; the name frees up when the deletion completes.
204Deleted; the name is free for reuse.
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.
409A concurrent queue update lost the race; retry.
429The per-account request rate cap is exceeded; retry after the Retry-After delay.
503The spool is momentarily unavailable.

429 headers

HeaderDescription
Retry-AfterSeconds until the next request is admitted.