> ## 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

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

```typescript
import { Client } from "@upstash/qstash";

const client = new Client({ token: "<QSTASH_TOKEN>" });
const schedules = client.schedules();
await schedules.create({
  destination: "https://my-api...",
  cron: "*/5 * * * *",
});
```

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

```typescript
import { Client } from "@upstash/qstash";

const client = new Client({ token: "<QSTASH_TOKEN>" });
const schedules = client.schedules();
await schedules.create({
  destination: "https://my-api...",
  cron: "0 * * * *",
  callback: "https://my-callback...",
  failureCallback: "https://my-failure-callback...",
});
```

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

```typescript
import { Client } from "@upstash/qstash";

const client = new Client({ token: "<QSTASH_TOKEN>" });
const schedules = client.schedules();
await schedules.create({
  destination: "my-topic",
  cron: "* * * * *",
});
```

#### Get a schedule by schedule id

```typescript
import { Client } from "@upstash/qstash";

const client = new Client({ token: "<QSTASH_TOKEN>" });
const schedules = client.schedules();
const res = await schedules.get("scheduleId");
console.log(res.cron);
```

#### List all schedules

```typescript
import { Client } from "@upstash/qstash";

const client = new Client({ token: "<QSTASH_TOKEN>" });
const schedules = client.schedules();
const allSchedules = await schedules.list();
console.log(allSchedules);
```

#### Delete a schedule

```typescript
import { Client } from "@upstash/qstash";

const client = new Client({ token: "<QSTASH_TOKEN>" });
const schedules = client.schedules();
await schedules.delete("scheduleId");
```
