---
title: "Create an on-call schedule"
method: POST
path: "/api/v1/schedules"
tags: ["On-call schedules"]
---

# Create an on-call schedule

`POST /api/v1/schedules`

## Request

- Base URL: `https://wardenpoint.com` (the document declares no server; this is the origin it was published from)
- URL: `https://wardenpoint.com/api/v1/schedules`
- Auth: API key in header `X-API-Key`

Creates an empty, active rotation. Idempotent by name: repeating the call with a name this company already uses returns the existing schedule with 200 instead of 201, so a retry after a timeout cannot produce twins with the shifts split between them. Fill it afterwards with POST /api/v1/schedules/{schedule}/rotation.

## Request body

- ScheduleRequest
  - `name` string, required: Repeating a create with a name that already exists in this company returns the existing schedule with 200 instead of creating a twin — retrying after a timeout is therefore safe.
  - `timezone` string, required: IANA zone name, e.g. "Europe/Warsaw" or "UTC". Validated against the zone database: an unknown name is rejected with 422 rather than stored, because a schedule with a bogus zone fails on the first rotation generation.
  - `default_handoff_day_of_week` integer: ISO-8601 weekday the weekly handoff happens on: 1 = Monday … 7 = Sunday. Defaults to 1 when omitted.
  - `default_handoff_hour` integer: Hour of the handoff in the schedule's timezone. Defaults to 9 when omitted.
  - `default_handoff_minute` integer: Minute of the handoff. Defaults to 0 when omitted.

## Response `200`

A schedule with this name already existed; it is returned unchanged.

- object
  - `data` Schedule: One rotation. The iCal subscription link and its revocation token are deliberately absent from every API response: that URL is a bearer credential for the whole roster and is issued only in the dashboard, by a human. Ask GET /api/v1/schedules/{schedule}/on-call or /shifts instead — they answer from the same resolver the feed renders from.
    - `uuid` string, uuid
    - `name` string
    - `timezone` string: IANA zone name, e.g. "Europe/Warsaw". Two things depend on it: the weekly handoff moment below is placed in this zone (so a DST change does not shift it), and shift and handover boundaries are RENDERED in it — a handoff set for 09:00 answers `09:00+02:00`. Changing it moves nothing in the database: existing shifts keep the very instants they had, and the new handoff position applies from the next rotation generation. Their rendered wall-clock does change, because it is now read in the new zone — the same instant, told differently.
    - `handoff` object: When the weekly baton passes, expressed in the schedule's own timezone. The rotation generator starts each week here, so a DST transition never moves the wake-up boundary.
      - `day_of_week` integer: ISO-8601 weekday: 1 = Monday … 7 = Sunday.
      - `hour` integer
      - `minute` integer
    - `is_active` boolean: An inactive schedule is skipped by escalation steps that target it — they fall through to the next target or to the step's fallback recipient. Shifts and overrides are kept.
    - `on_call` ScheduleOnCall: Who is on duty per role at the moment asked about. A role with nobody on duty is absent from the object — an empty object means the rotation covers nobody right now.
      - `primary` object: First to be paged.
        - `uuid` string, uuid
        - `name` string
      - `secondary` object: Covers when primary does not acknowledge.
        - `uuid` string, uuid
        - `name` string
      - `manager` object: Operational escalation tier for prolonged incidents.
        - `uuid` string, uuid
        - `name` string
    - `created_at` string, date-time
    - `updated_at` string, date-time

## Other responses

- `201`: Created.
- `401`: API key missing, invalid, revoked or expired.
- `403`: API key lacks the config.write ability.
- `404`: On-call schedules are switched off for this deployment.
- `422`: Validation failed — most often an unknown timezone name.

---

[API](https://skmtc.dev/wardenpoint/apis/wardenpoint-api.md) · [All operations](https://skmtc.dev/wardenpoint/apis/wardenpoint-api/llms.txt) · [OpenAPI document](https://skmtc.dev/wardenpoint/apis/wardenpoint-api/revisions/259ee445728e?raw)
