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

# List Schedules

> This endpoint returns a list of all schedules.

## Response

<ResponseField name="Schedules" type="Array<Schedule>" required>
  <Expandable title="Schedule">
    <ResponseField name="content" type="Content" rqeuired>
      <Expandable title="Content">
        <ResponseField name="body" type="Array<int>" required>
          The raw http request body encoded in base64.
        </ResponseField>

        <ResponseField name="header" type="Record<string, string[]>" required>
          The HTTP headers sent to your API.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="createdAt" type="int">
      Unix timestamp with millisecond precision when the schedule was created.
    </ResponseField>

    <ResponseField name="cron" type="string" required>
      The cron expression.
    </ResponseField>

    <ResponseField name="destination" type="Destination" required>
      Destination of the schedule. The destination can either be a URL or a topic. Check the `type` field first to determine which one it is.

      <Expandable title="Destination">
        <ResponseField name="topic" type="Topic">
          <Expandable>
            <ResponseField name="endpoints" type="Array<Endpoint>" required>
              <Expandable title="Endpoint">
                <ResponseField name="endpointId" type="string" required>
                  The id of the endpoint.
                </ResponseField>

                <ResponseField name="topicId" type="string" required>
                  The id of the topic this endpoint subscribes to.
                </ResponseField>

                <ResponseField name="url" type="string" required>
                  The url where all requests will be sent to.
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="name" type="string" required>
              A user given name must only contain alphanumeric, hyphen, underscore and periods.
            </ResponseField>

            <ResponseField name="topicId" type="string" required>
              Id for this topic
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="type" type="string" required>
          Determines the type of the destination, either topic or url. Depending on this field, either the topic or url field will be set.
        </ResponseField>

        <ResponseField name="url" type="string">
          The url of the destination. Only set if `type` is `url`.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="scheduleId" type="string" required>
      The unique id of the schedule
    </ResponseField>

    <ResponseField name="settings" type="Settings" required>
      <Expandable title="Settings">
        <ResponseField name="deadline" type="int">
          The time at which message should be delivered at the latest
        </ResponseField>

        <ResponseField name="delay" type="int">
          The delay in seconds before the message is delivered.
        </ResponseField>

        <ResponseField name="notBefore" type="int">
          The time before which the message should not be delivered.
        </ResponseField>

        <ResponseField name="retries" type="int">
          The number of retries that should be attempted in case of delivery failure.
        </ResponseField>

        <ResponseField name="callback" type="string">
          The delay in seconds before the message is delivered..
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```shell curl
  curl -XGET https://qstash.upstash.io/v1/schedules \
    -H "Authorization: Bearer <token>"
  ```
</RequestExample>

<ResponseExample>
  ```json 200
  [
    {
      "scheduleId": "scd_5mA1sL5RX6YphLfBnRTtiYPzZ8pt",
      "cron": "0 * * * *",
      "createdAt": 1691245856333,
      "content": {
        "header": {
          "Content-Type": ["application/json"]
        },
        "body": "{\"message\":\"hello\"}"
      },
      "destination": {
        "topic": {
          "topicId": "tpc_7EfEryZiheEKzpMuvjYdhhhbNNJA",
          "name": "test",
          "endpoints": [
            {
              "endpointId": "ept_6j7BNZus3ZyPy6P7QtLUMCC3Rq7h",
              "url": "https://www.example.com",
              "topicId": "tpc_7EfEryZiheEKzpMuvjYdhhhbNNJA"
            }
          ],
        "type": "url",
        "url": "https://www.example.com"
      },
      "settings": {
        "retries": 3
      }
    }
  ]
  ```
</ResponseExample>
