Messages

Bulk Cancel Messages

Delete all pending messages

DELETE/v2/messages
cURL
curl --request DELETE \
  --url https://qstash-{region}.upstash.io/v2/messages \
  --header 'Authorization: Bearer <token>'
200Response
{
  "cancelled": 123
}

Authorization

Authorizationheaderstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters

messageIdsquerystring[]

A list of message IDs to delete. If provided, other filters are ignored.

topicNamequerystring[]

Filter messages by URL Group name. Supports multiple values.

queueNamequerystring[]

Filter messages by Queue name. Supports multiple values.

urlquerystring[]

Filter messages by destination URL. Supports multiple values.

hostquerystring[]

Filter messages by the host of the destination URL. Supports multiple values.

pathquerystring[]

Filter messages by the path of the destination URL. Supports multiple values.

labelquerystring[]

Filter messages by label. Supports multiple values. You can pass multiple values to match messages with any of the given labels (OR logic).

Examples:

  • label=my_label
  • label=label_1&label=label_2
  • label=label_1,label_2
flowControlKeyquerystring[]

Filter messages by Flow Control Key. Supports multiple values.

fromDatequeryinteger

Filter messages created after this timestamp (Unix milli, inclusive).

toDatequeryinteger

Filter messages created before this timestamp (Unix milli, inclusive).

scheduleIdquerystring[]

Filter messages by Schedule ID. Supports multiple values.

callerIpquerystring[]

Filter messages by the IP address of the publisher. Supports multiple values.

callerIPquerystring[]

Deprecated. Use callerIp instead.

countqueryinteger

Maximum number of messages to delete, between 1 and 500. If not provided, all messages matching the filters will be deleted.

Response

200 — All messages deleted successfully

cancelledinteger

Number of messages cancelled

Loading search…