---
title: "Update a schedule"
method: PATCH
path: "/v1/contexts/{contextId}/schedules/{scheduleId}"
tags: ["Configuration Schedules"]
---

# Update a schedule

`PATCH /v1/contexts/{contextId}/schedules/{scheduleId}`

Use this endpoint to update an existing reconciliation schedule. You can modify the cron expression and enabled status.

## Path parameters

- `contextId` string, required
- `scheduleId` string, required

## Headers

- `X-Request-Id` string
- `X-Idempotency-Key` string

## Request body

- UpdateScheduleRequest — Payload for updating a reconciliation schedule
  - `cronExpression` string — Updated cron expression
  - `enabled` boolean — Updated enabled status

## Response `200`

Schedule updated.

The response includes the `X-Idempotency-Replayed` header.

If the value is false, the request was just processed. If the value is true, the response is a replay of a previously processed request.

See [Retries and idempotency](/en/reference/retries-idempotency) for more details.

- ScheduleResponse — Cron-based reconciliation schedule
  - `id` string, uuid — Unique identifier for the schedule
  - `contextId` string, uuid — Context this schedule belongs to
  - `cronExpression` string — Cron expression defining the schedule
  - `enabled` boolean — Whether the schedule is active
  - `lastRunAt` string, date-time — Last successful run time in RFC 3339 format
  - `nextRunAt` string, date-time — Next scheduled run time in RFC 3339 format
  - `createdAt` string, date-time — Creation timestamp in RFC 3339 format
  - `updatedAt` string, date-time — Last update timestamp in RFC 3339 format

## Other responses

- `400` — The request contains invalid parameters or payload.
- `401` — The request lacks valid authentication credentials.
- `403` — You do not have permission to access this resource.
- `404` — Schedule not found
- `500` — An unexpected error occurred on the server.

---

[API](https://skmtc.net/lerian/apis/identity-plugin.md) · [All operations](https://skmtc.net/lerian/apis/identity-plugin/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lerian/identity-plugin/versions/25daba385532/schema)
