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

# Create a schedule

`POST /v1/contexts/{contextId}/schedules`

Use this endpoint to create a cron-based reconciliation schedule for automatic matching within a context.

## Path parameters

- `contextId` string, required

## Headers

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

## Request body

- CreateScheduleRequest — Payload for creating a reconciliation schedule
  - `cronExpression` string, required — Cron expression defining the schedule frequency
  - `enabled` boolean — Whether the schedule should be active immediately

## Response `201`

Schedule created.

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` — Context 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)
