---
title: "Clear a queue"
method: POST
path: "/v1/queue.clear"
tags: ["Querator V1"]
---

# Clear a queue

`POST /v1/queue.clear`

Clears all data from a queue, optionally clears all defer and scheduled items

## Request body

- QueueClearRequest
  - `queue_name` string, required — The name of the queue to clear
  - `defer` boolean, required — Indicates the 'defer' queue will be cleared. If true, any items scheduled to be retried at a future date will be removed.
  - `scheduled` boolean, required — Indicates any 'scheduled' items in the queue will be cleared. If true, any items scheduled to be enqueued at a future date will be removed.
  - `queue` boolean, required — Indicates any items currently waiting in the FIFO queue will clear. If true, any items in the queue which have NOT been reserved will be removed.
  - `destructive` string, required — Indicates the Defer,Scheduled,Queue operations should be destructive in that all data regardless of status will be removed. For example, if used with ClearRequest.Queue = true, then ALL items in the queue regardless of reserve status will be removed. This means that clients who currently have ownership of those items will not be able to "complete" those items, as querator will have no knowledge of those items.

## Response `200`

- Reply
  - `code` integer, required
  - `code_text` string, required
  - `message` string, required
  - `details` object, required
    - `key` string, required

## Changes

- **2024-09-15** `ba3240950bb2` — 2 breaking, 1 warning, 4 info
  - added the new required request property `defer`
  - the `destructive` request property type/format changed from `boolean`/`` to `string`/``
  - removed the request property `retry`
  - request body became optional
  - …3 more

[Change history](https://skmtc.dev/kapetan-io/apis/querator-api/changes/v1/queue.clear/post.md)

---

[API](https://skmtc.dev/kapetan-io/apis/querator-api.md) · [All operations](https://skmtc.dev/kapetan-io/apis/querator-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kapetan-io/querator-api/revisions/ba3240950bb2/schema)
