---
title: "Copy Shift Week"
method: POST
path: "/scheduling/shifts/copy-week"
tags: ["scheduling"]
---

# Copy Shift Week

`POST /scheduling/shifts/copy-week`

## Request

- Base URL: `https://api.verdun.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.verdun.ai/scheduling/shifts/copy-week`
- Auth: HTTP bearer

Copy one week's shift blocks onto another (the grid's "copy to next week").

Writes only into an empty target week unless `replace` is set; otherwise
answers `target_not_empty` with the count and writes nothing, so the
console can confirm before overwriting. Not deprecated with the hourly
pair below: it operates on blocks and survives the calendar migration.

## Request body

- CopyShiftWeekRequest: Duplicate one week's shift blocks onto another week. Weeks are addressed by their first day and must be a whole number of weeks apart, so every block lands on the same WEEKDAY it left - that is what "the same schedule next week" means. The endpoint is the one-click "copy to next week" on the Admin > Shifts grid, but any two aligned weeks work.
  - `source_week_start` string, date, required: Center-local first day of the week being copied.
  - `target_week_start` string, date, required: Center-local first day of the week being written. Must be a non-zero multiple of 7 days from source_week_start.
  - `replace` boolean: When the target week already holds shifts: false = write nothing and report `target_not_empty`; true = delete them first so the target becomes an exact copy of the source.

## Response `200`

Successful Response

- CopyShiftWeekResponse
  - `status` 'copied' | 'target_not_empty', required: `copied` = the target week now mirrors the source week. `target_not_empty` = the target already held shifts and `replace` was false, so NOTHING was written; retry with replace=true to overwrite.
  - `copied` integer, required: Shift blocks created in the target week.
  - `removed` integer, required: Pre-existing target-week blocks deleted (replace=true only).
  - `existing` integer, required: Blocks the target week held before the call (the count behind target_not_empty).
  - `target_week_start` string, date, required: Echo of the request's target week.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/verdun/apis/verdun-api.md) - [All operations](https://skmtc.dev/verdun/apis/verdun-api/llms.txt) - [OpenAPI document](https://skmtc.dev/verdun/apis/verdun-api/revisions/35a2a6ebedda?raw)
