You can run the async code by importing Client from upstash_qstash.asyncio and awaiting the methods.

Messages are removed from the database shortly after they’re delivered, so you will not be able to retrieve a message after. This endpoint is intended to be used for accessing messages that are in the process of being delivered/retried.

Retrieve a message

from upstash_qstash import Client

client = Client("<QSTASH_TOKEN>")
messages = client.messages()
msg = messages.get("msg_id")

Cancel/delete a message

from upstash_qstash import Client

client = Client("<QSTASH_TOKEN>")
messages = client.messages()
msg = messages.delete("msg_id")