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

# Create a new schedule

`POST /api/schedules`

## Request body

- object
  - `key` string — Non-unique asset directory namespace (for example shared/ or personal/<user-id>/drafts/). Runtime write boundaries normalize and validate the canonical form.
  - `name` string, required
  - `description` string
  - `cronExpression` string
  - `intervalMs` integer
  - `taskTemplate` string
  - `taskType` string
  - `tags` string[]
  - `priority` integer
  - `targetAgentId` string
  - `enabled` boolean
  - `timezone` string
  - `model` string
  - `modelTier` 'smol' | 'regular' | 'smart' | 'ultra'
  - `scheduleType` 'recurring' | 'one_time'
  - `targetType` 'agent-task' | 'workflow' | 'script'
  - `workflowId` string, uuid
  - `scriptName` string
  - `scriptArgs` object
  - `delayMs` integer
  - `runAt` string

## Response `201`

Schedule created

- object
  - `id` string, uuid, required
  - `key` string, required — Non-unique asset directory namespace (for example shared/ or personal/<user-id>/drafts/). Runtime write boundaries normalize and validate the canonical form.
  - `name` string, required
  - `description` string
  - `cronExpression` string
  - `intervalMs` integer
  - `taskTemplate` string
  - `taskType` string
  - `tags` string[]
  - `priority` integer
  - `targetAgentId` string
  - `enabled` boolean
  - `lastRunAt` string, date-time
  - `nextRunAt` string, date-time
  - `createdByAgentId` string
  - `timezone` string
  - `consecutiveErrors` integer
  - `lastErrorAt` string, date-time
  - `lastErrorMessage` string
  - `model` string
  - `modelTier` 'smol' | 'regular' | 'smart' | 'ultra'
  - `scheduleType` 'recurring' | 'one_time'
  - `targetType` 'agent-task' | 'workflow' | 'script'
  - `workflowId` string, uuid
  - `scriptName` string
  - `scriptArgs` object
  - `createdAt` string, date-time, required
  - `lastUpdatedAt` string, date-time, required
  - `createdBy` string
  - `updatedBy` string
  - `favorite` boolean

## Other responses

- `400` — Validation error
- `409` — Duplicate name

## Changes

- **2026-08-19** `5657aaae1bab` — 2 warning
  - the `priority` request property's max was set to `100.00`
  - the `priority` request property's min was set to `0.00`
- **2026-08-07** `06cac6a7c5bc` — 3 info
  - added the media type `application/json` for the response with the status `201`
  - added the media type `application/json` for the response with the status `400`
  - added the media type `application/json` for the response with the status `409`
- **2026-07-28** `cf533d6b49b0` — 1 info
  - the `targetAgentId` request property format was generalized from `uuid` to no format
- **2026-07-11** `f1022d5edb0d` — 1 info
  - added the new optional request property `key`
- **2026-07-02** `0c910612f9ac` — 1 warning
  - removed the request property `key`

[Change history](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/changes/api/schedules/post.md)

---

[API](https://skmtc.dev/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/desplega-ai/agent-swarm-api/revisions/e0acd2155cad/schema)
