---
title: "Create a scheduled task."
method: POST
path: "/v1/schedules"
tags: ["Schedules"]
---

# Create a scheduled task.

`POST /v1/schedules`

## Request body

- ScheduleCreateRequest — Provide exactly one of `payload` or `payload_base64`.
  - `name` string, required
  - `schedule` string, required — Cron expression (standard five-field form).
  - `queue` string, required
  - `task_type` string, required
  - `payload` unknown
  - `payload_base64` string, byte
  - `deadline_offset` string — Go duration string (e.g. `30s`). At scheduled enqueue time the task's absolute deadline is computed by adding this offset to creation.
  - `max_tries` integer

## Response `201`

Schedule created.

- Schedule — Scheduled task as stored by the library. `payload` is base64-encoded. `deadline` is an int64 nanosecond duration offset (the library's `time.Duration` JSON form).
  - `name` string, required
  - `schedule` string, required — Cron expression.
  - `queue` string, required
  - `task_type` string, required
  - `payload` string, byte
  - `deadline` integer
  - `max_tries` integer
  - `created_at` string, date-time, required

## Other responses

- `400` — Input validation error.
- `409` — State conflict, e.g. duplicate resource or blocked transition.

---

[API](https://skmtc.net/choria-io/apis/asyncjobs-http-api.md) · [All operations](https://skmtc.net/choria-io/apis/asyncjobs-http-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/choria-io/asyncjobs-http-api/versions/48b17d96adbf/schema)
