---
title: "Bulk Cancel Messages"
method: DELETE
path: "/v2/messages"
tags: ["Messages"]
---

# Bulk Cancel Messages

`DELETE /v2/messages`

## Request

- Base URL: `https://qstash-eu-central-1.upstash.io`
- URL: `https://qstash-eu-central-1.upstash.io/v2/messages`
- Auth: one of:
  - HTTP bearer
  - API key in query parameter `qstash_token`
- TypeScript: <https://skmtc.dev/upstash/apis/qstash-rest-api/docs/v2/messages/delete.ts> (a function with typed inputs; its response is checked against the schema)

Delete all pending messages

## Query parameters

- `messageIds` string[]
- `topicName` string[]
- `queueName` string[]
- `url` string[]
- `host` string[]
- `path` string[]
- `label` string[]
- `flowControlKey` string[]
- `fromDate` integer
- `toDate` integer
- `scheduleId` string[]
- `callerIp` string[]
- `callerIP` string[]
- `async` boolean
- `count` integer

## Response `202`

Messages cancelled, or the bulk action is created when `async=true`.

- object
  - `cancelled` integer: When cancelling by `messageIds`, the number of messages cancelled. For filter-based cancels, the number of in-progress messages that matched the filters when the request was accepted.
  - `actionId` string: The ID of the bulk action. Only returned for filter-based cancels with `async=true`.

## Other responses

- `400`: Bad request
- `412`: Too many bulk actions are in progress. Up to 1000 bulk actions can be in progress at the same time.
- `429`: The bulk action did not finish within one minute. It keeps running in the background and can be tracked via `GET /v2/bulkActions`.

## Changes

- **2026-09-16** `ed23e37f87f3`: 1 breaking, 6 info
  - removed the success response with the status `200`
  - added the new optional `query` request parameter `async`
  - `query` request parameter `count` was deprecated
  - added the non-success response with the status `400`
  - …3 more
- **2026-06-10** `6afae1d18547`: 2 warning, 10 info
  - for the `query` request parameter `count`, the max was set to `500.00`
  - for the `query` request parameter `count`, the min was set to `1.00`
  - added the new optional `query` request parameter `callerIp`
  - added the new optional `query` request parameter `host`
  - …8 more
- **2026-06-09** `d30bd0904328`: 1 info
  - for the `query` request parameter `label`, the type was generalized from `string` to `array`
- **2026-06-09** `d859c277ced2`: 1 info
  - for the `query` request parameter `label`, the type was generalized from `array` to `string`
- **2026-05-15** `75ecd1c6fb73`: 1 info
  - for the `query` request parameter `label`, the type was generalized from `string` to `array`

[Operation history](https://skmtc.dev/upstash/apis/qstash-rest-api/changes/v2/messages/delete.md)

---

[API](https://skmtc.dev/upstash/apis/qstash-rest-api.md) - [All operations](https://skmtc.dev/upstash/apis/qstash-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/upstash/apis/qstash-rest-api/revisions/0c3b83ef4770?raw)
