# Update schedule

```http
PATCH /projects/{project_reference}/schedules/{schedule_id}
```

Change the fields of a schedule, or pause and resume it with the status, where an omitted field keeps its value; returns the updated schedule. Requires project.runs.write.

## Parameters

| Name                | In   | Required | Description  |
| ------------------- | ---- | -------- | ------------ |
| `project_reference` | path | Yes      |              |
| `schedule_id`       | path | Yes      | Schedule ID. |

## Request body

| Field                           | Type         | Required | Description                                                                  |
| ------------------------------- | ------------ | -------- | ---------------------------------------------------------------------------- |
| `name`                          | string       |          | Human-readable schedule name.                                                |
| `target`                        | object       |          | Typed schedule target.                                                       |
| `schedule`                      | string       |          | Schedule expression, for example a cron expression.                          |
| `timezone`                      | string       |          | IANA timezone used to evaluate the schedule.                                 |
| `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.                                   |
| `status`                        | string       |          | Updated schedule status.                                                     |

## Responses

| Status | Description                                                                                                      |
| ------ | ---------------------------------------------------------------------------------------------------------------- |
| 200    | Updated schedule. Requires project run-write authorization, retaining source ownership and runtime target rules. |
| 400    | invalid\_input: invalid body or parameters                                                                       |
| 401    | unauthenticated                                                                                                  |
| 403    | forbidden: a project member without project.runs.write                                                           |
| 404    | not\_found: project or schedule not found or not visible                                                         |
| 500    | internal                                                                                                         |
| 503    | internal: authentication state is temporarily unavailable and the request was not processed; retry shortly.      |
