If you provide a set of message IDs in the request, only those messages will be cancelled.
If you include filter parameters in the request, only the messages that match the filters will be canceled.
If no filter or messageIds are sent, QStash will cancel all of your messages.
Cancelling by messageIds is synchronous, and cancelled is the exact number of messages cancelled.
A filter-based cancel (including cancelling all messages) is tracked as a bulk action and runs in the background:
- By default, the request waits up to one minute for the bulk action to finish. If it does not finish in time, a
429is returned, and the bulk action keeps running in the background. - With
async=true, the request returns right after the bulk action is created, together with itsactionId. You can follow its progress with Get a Bulk Action. cancelledis the number of in-progress messages that matched the filters when the request was accepted, not the number of messages actually cancelled.- Sending the same filters again while an identical bulk action is still in progress does not start a new one. The in-progress bulk action is returned instead.
- Up to 1000 bulk actions can be in progress at the same time. Beyond that, a
412is returned.
For multi-value filters, a message matches if its value equals any of the given values (OR logic), and multiple filters are combined with AND logic.
Multiple values can be passed either by repeating the query parameter (label=label_1&label=label_2) or as a single comma-separated value (label=label_1,label_2).