DELETE
/
v2
/
messages

Bulk cancel allows you to cancel multiple messages at once.

Cancelling a message will remove it from QStash and stop it from being delivered in the future. If a message is in flight to your API, it might be too late to cancel.

If you provide a set of message IDs in the body of the request, only those messages will be cancelled.

If you include filter parameters in the request body, only the messages that match the filters will be canceled.

If no body is sent, QStash will cancel all of your messages.

This operation scans all your messages and attempts to cancel them. If an individual message cannot be cancelled, it will not continue and will return an error message. Therefore, some messages may not be cancelled at the end. In such cases, you can run the bulk cancel operation multiple times.

You can filter the messages to cancel by including filter parameters in the request body.

Request

messageIds
Array

The list of message IDs to cancel.

queueName
string

Filter messages to cancel by queue name.

url
string

Filter messages to cancel by destination URL.

topicName
string

Filter messages to cancel by URL Group (topic) name.

fromDate
number

Filter messages to cancel by starting date, in milliseconds (Unix timestamp). This is inclusive.

toDate
number

Filter messages to cancel by ending date, specified in milliseconds (Unix timestamp). This is inclusive.

scheduleId
string

Filter messages to cancel by schedule ID.

callerIP
string

Filter messages to cancel by IP address of publisher.

Response

A cancelled object with the number of cancelled messages.

{
  "cancelled": number
}