---
title: "Create Schedule"
method: POST
path: "/api/v1/workspaces/{workspace_id}/schedules"
tags: ["schedules"]
---

# Create Schedule

`POST /api/v1/workspaces/{workspace_id}/schedules`

## Path parameters

- `workspace_id` string, uuid4, required

## Request body

- CreateScheduleRequestDto
  - `name` string
  - `host` 'SELF' | 'ASKUI'
  - `runner_ids` string[]
  - `tags` string[]
  - `started_at` string, date-time — Timestamp after which the schedule starts. If not specified, the schedule starts immediately.
  - `ended_at` string, date-time, nullable
  - `ended_after` integer, nullable — Number of runs (more specifically, completions) after which the schedule ends, i.e., no more runs will be scheduled. If both ended_at and ended_after are specified, the schedule will end when either condition is met. If neither is specified, the schedule will run indefinitely.
  - `schedule` string, nullable — Cron expression specifying the schedule. If not specified, the schedule will run once on when started_at is reached which is now by default. end_at and ended_after will be ignored if schedule is not specified.
  - `workflows` string[], nullable — List of paths (not starting with '/' but relative to root of workspace) of workflows to be executed. Each string is a syntactically valid s3 object key or prefix. Cannot be empty. Strings starting with '.' will be ignored.
  - `data` object — Arbitrary data to be stored with the schedule which is made available to the runner when executing AskUI workflows.

## Response `201`

Successful Response

- CreateScheduleResponseDto
  - `id` string
  - `created_at` string, date-time
  - `name` string, required
  - `status` 'ACTIVE' | 'SUSPENDED' | 'ENDED'
  - `started_at` string, date-time, required
  - `ended_at` string, date-time, nullable
  - `schedule` string, nullable
  - `ended_after` integer, nullable
  - `run_template` RunTemplate, required
    - `workspace_id` string, required
    - `workflows` string[], nullable
    - `runner_assignment` RunnerAssignment, required
      - `ids` string[]
      - `host` 'SELF' | 'ASKUI', required
      - `tags` string[]
    - `data` object
  - `runs_count` integer

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/askui/apis/askui-workspaces-api.md) · [All operations](https://skmtc.dev/askui/apis/askui-workspaces-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/askui/askui-workspaces-api/revisions/b796c74292ac/schema)
