> ## Documentation Index
> Fetch the complete documentation index at: https://upstash-vector.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Schedules

<Info>
  You can run the async code by importing `Client` from `upstash_qstash.asyncio`
  and awaiting the methods.
</Info>

#### Create a schedule that runs every 5 minutes

```python
from upstash_qstash import Client

client = Client("<QSTASH_TOKEN>")
schedules = client.schedules()
res = schedules.create({
  "destination": "https://my-api...",
  "cron": "*/5 * * * *",
})

print(res["scheduleId"])
```

#### Create a schedule that runs every hour and sends the result to a [callback URL](/qstash/features/callbacks)

```python
from upstash_qstash import Client

client = Client("<QSTASH_TOKEN>")
schedules = client.schedules()
schedules.create({
  "destination": "https://my-api...",
  "cron": "0 * * * *",
  "callback": "https://my-callback...",
  "failure_callback": "https://my-failure-callback...",
})
```

#### Create a schedule to a topic that runs every minute

```python
from upstash_qstash import Client

client = Client("<QSTASH_TOKEN>")
schedules = client.schedules()
schedules.create({
  "destination": "my-topic",
  "cron": "* * * * *",
})
```

#### Get a schedule by schedule id

```python
from upstash_qstash import Client

client = Client("<QSTASH_TOKEN>")
schedules = client.schedules()
res = schedules.get("scheduleId")
print(res["cron"])
```

#### List all schedules

```python
from upstash_qstash import Client

client = Client("<QSTASH_TOKEN>")
schedules = client.schedules()
all_scheds = schedules.list()
print(all_scheds)
```

#### Delete a schedule

```python
from upstash_qstash import Client

client = Client("<QSTASH_TOKEN>")
schedules = client.schedules()
schedules.delete("scheduleId")
```
