---
title: "Create a schedule"
method: POST
path: "/api/v1/schedules"
tags: ["schedules"]
---

# Create a schedule

`POST /api/v1/schedules`

Create a new `IMPERATIVE` schedule based on the specified options.

## Request body

- CreateScheduleOptions
  - `task` string, required
  - `cron` string, required
  - `deduplicationKey` string, required
  - `externalId` string
  - `timezone` string — Defaults to "UTC". In IANA format ("America/New_York"). If set then it will trigger at the CRON frequency in that timezone and respect daylight savings time.

## Response `200`

Schedule created successfully

- ScheduleObject
  - `id` string — The unique ID of the schedule, prefixed with 'sched_'
  - `task` string — The id of the scheduled task that will be triggered by this schedule
  - `type` string — The type of schedule, `DECLARATIVE` or `IMPERATIVE`. Declarative schedules are declared in your code by setting the `cron` property on a `schedules.task`. Imperative schedules are created in the dashboard or by using the imperative SDK functions like `schedules.create()`.
  - `active` boolean — Whether the schedule is active or not
  - `deduplicationKey` string — The deduplication key used to prevent creating duplicate schedules
  - `externalId` string — The external ID of the schedule. Can be anything that is useful to you (e.g., user ID, org ID, etc.)
  - `generator` object
    - `type` 'CRON'
    - `expression` string — The cron expression used to generate the schedule
    - `description` string — The description of the generator in plain english
  - `timezone` string — Defaults to UTC. In IANA format, if set then it will trigger at the CRON frequency in that timezone and respect daylight savings time.
  - `nextRun` string, date-time — The next time the schedule will run
  - `environments` ScheduleEnvironment[]
    - `id` string
    - `type` string
    - `userName` string

## Other responses

- `400` — Invalid request parameters
- `401` — Unauthorized
- `422` — Unprocessable Entity

---

[API](https://skmtc.net/winsenlabs/apis/trigger-dev-v3-rest-api.md) · [All operations](https://skmtc.net/winsenlabs/apis/trigger-dev-v3-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/winsenlabs/trigger-dev-v3-rest-api/versions/737c498e605b/schema)
