# Create schedule

```http
POST /projects/{project_reference}/schedules
```

Create a recurring schedule that starts a task, a workflow or an agent on a cron expression, or, on REST and GraphQL only, activate a schedule declared in source (the MCP tool creates manual schedules only); returns the schedule: a new schedule is active, and a source schedule that was activated before keeps its current status. Requires project.runs.write.

## Parameters

| Name                | In   | Required | Description |
| ------------------- | ---- | -------- | ----------- |
| `project_reference` | path | Yes      |             |

## Request body

| Field                           | Type         | Required | Description                                                                                                                                                                                     |
| ------------------------------- | ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`                          | string       | Yes      | Human-readable schedule name.                                                                                                                                                                   |
| `target`                        | object       | Yes      | Typed schedule target.                                                                                                                                                                          |
| `schedule`                      | string       | Yes      | Schedule expression, for example a cron expression.                                                                                                                                             |
| `timezone`                      | string       |          | IANA timezone used to evaluate the schedule. Defaults to UTC.                                                                                                                                   |
| `runtime_target_kind`           | string       |          | Runtime target kind for scheduled runs.                                                                                                                                                         |
| `runtime_target_environment_id` | string,null  |          | Environment ID when runtime\_target\_kind is environment.                                                                                                                                       |
| `runtime_target_branch_id`      | string,null  |          | Branch ID when runtime\_target\_kind is preview\_branch.                                                                                                                                        |
| `config`                        | object       |          | Run configuration. For agent schedules, put the run prompt in config.prompt.                                                                                                                    |
| `timeout_seconds`               | integer      |          | Per-run timeout in seconds.                                                                                                                                                                     |
| `backoff_limit`                 | integer      |          | Retry backoff limit for failed scheduled runs.                                                                                                                                                  |
| `concurrency_policy`            | string       |          | How overlapping scheduled runs are handled.                                                                                                                                                     |
| `max_runs`                      | integer,null |          | Optional maximum number of scheduled runs.                                                                                                                                                      |
| `definition_source`             | string       |          | manual (the default), or source to activate a schedule declared in source, which requires source\_trigger\_id, source\_path and source\_hash.                                                   |
| `source_trigger_id`             | string       |          | Trigger id from the source definition. When a schedule with this id already exists, creating it from source can return that schedule with its current status; a paused schedule remains paused. |
| `source_path`                   | string       |          | Source file path of the source schedule.                                                                                                                                                        |
| `source_hash`                   | string       |          | Source definition hash of the source schedule.                                                                                                                                                  |

## Responses

| Status | Description                                                                                                 |
| ------ | ----------------------------------------------------------------------------------------------------------- |
| 201    | Created an active recurring project schedule for a task, workflow, or agent target.                         |
| 400    | invalid\_input: invalid body or parameters                                                                  |
| 401    | unauthenticated                                                                                             |
| 403    | forbidden: a project member without project.runs.write                                                      |
| 404    | not\_found: project or target not found or not visible                                                      |
| 500    | internal                                                                                                    |
| 503    | internal: authentication state is temporarily unavailable and the request was not processed; retry shortly. |
