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

# Schedules

In addition to sending a message once, you can create a schedule, and we will
publish the message in the given period. To create a schedule, you simply need
to add the `Upstash-Cron` header to your `publish` request.

Schedules can be configured using `cron` expressions.
[crontab.guru](https://crontab.guru/) is a great tool for understanding and
creating cron expressions.

We use `UTC` as timezone when evaluating cron expressions.

The following request would create a schedule that will automatically publish
the message every minute:

<CodeGroup>
  ```shell cURL
  curl -XPOST \
      -H 'Authorization: Bearer XXX' \
      -H "Content-type: application/json" \
      -H "Upstash-Cron: * * * * *" \
      -d '{ "hello": "world" }' \
      'https://qstash.upstash.io/v2/schedules/https://example.com'
  ```

  ```typescript Typescript
  import { Client } from "@upstash/qstash";

  const client = new Client({ token: "<QSTASH_TOKEN>" });
  const schedules = client.schedules();
  await schedules.create({
    destination: "example.com",
    cron: "* * * * *",
  });
  ```

  ```python Python
  from upstash_qstash import Client

  client = Client("<QSTASH_TOKEN>")
  schedules = client.schedules()
  res = schedules.create({
    "destination": "example.com",
    "cron": "* * * * *",
  })
  ```
</CodeGroup>

All of the [other config options](/qstash/howto/publishing#optional-parameters-and-configuration)
can still be used.

<Info>
  It can take up to 60 seconds for the schedule to be loaded on an active node and
  triggered for the first time.
</Info>

You can see and manage your schedules in the
[Upstash Console](https://console.upstash.com/qstash).

### Scheduling to a topic

Instead of scheduling a message to a specific URL, you can also create a
schedule, that publishes to a topic. Simply use either the topic name or its id:

<CodeGroup>
  ```bash cURL
  curl -XPOST \
      -H 'Authorization: Bearer XXX' \
      -H "Content-type: application/json" \
      -H "Upstash-Cron: * * * * *" \
      -d '{ "hello": "world" }' \
      'https://qstash.upstash.io/v2/schedules/<TOPIC_ID_OR_NAME>'
  ```

  ```typescript Typescript
  import { Client } from "@upstash/qstash";

  const client = new Client({ token: "<QSTASH_TOKEN>" });
  const schedules = client.schedules();
  await schedules.create({
    destination: "topicName",
    cron: "* * * * *",
  });
  ```

  ```python Python
  from upstash_qstash import Client

  client = Client("<QSTASH_TOKEN>")
  schedules = client.schedules()
  res = schedules.create({
    "destination": "topic_name",
    "cron": "* * * * *",
  })
  ```
</CodeGroup>
