Bulk Cancel Messages
Stop delivery of multiple messages at once
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
The list of message IDs to cancel.
Filter messages to cancel by queue name.
Filter messages to cancel by destination URL.
Filter messages to cancel by URL Group (topic) name.
Filter messages to cancel by starting date, in milliseconds (Unix timestamp). This is inclusive.
Filter messages to cancel by ending date, specified in milliseconds (Unix timestamp). This is inclusive.
Filter messages to cancel by schedule ID.
Filter messages to cancel by IP address of publisher.
Response
A cancelled object with the number of cancelled messages.
Was this page helpful?