Appearance
Delete a queue
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 204 once the deletion is complete and the name is free for reuse, or 202 if it does not complete within the request window. 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. With uid, only the queue that uid names is deleted, so a retry cannot delete a queue created under the same name since.
Sample
sh
curl -X DELETE "$SPOOLER_API/spools/<spool>/queues/<queue>?mode=<mode>" \
-H "Authorization: Bearer $SPOOLER_KEY"Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
spool | path | IdentName, 1–63 chars, ^[A-Za-z0-9_:-]+$ | yes | The spool name. |
queue | path | IdentName, 1–63 chars, ^[A-Za-z0-9_:-]+$ | yes | The queue name. |
mode | query | force / drain | yes | force 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. |
uid | query | QueueUid, 1–128 chars, ^[A-Za-z0-9_-]+$ | no | The uid of the queue to delete, as Queue reports it. When the queue under the name is another, the answer is 412 queue_replaced and nothing is changed. Absent deletes whatever queue has the name. |
Responses
| Status | Description |
|---|---|
202 | Deletion 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. |
204 | Deleted; the name is free for reuse. |
400 | The request is malformed; the kind names the problem. |
401 | The API key is missing or not recognized; the kind is unauthenticated. |
402 | The account is suspended; the kind is account_suspended. |
403 | The operation is refused; the kind names why: a plan limit (queue_limit, retention_limit), or account_blocked on any operation when the account is on an abuse hold. |
404 | The spool or queue does not exist; the kind says which. |
409 | A concurrent queue update lost the race; retry. |
412 | The queue under the name is not the one the uid names: it was created again since. Nothing was changed. The kind is queue_replaced; details.uid is the current queue's. |
429 | The 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. |
503 | The spool is momentarily unavailable. |
429 headers
| Header | Description |
|---|---|
Retry-After | Seconds until the next request is admitted, whole and at least 1; always the delay-seconds form, never an HTTP-date. |