---
title: "Create a new shift"
method: POST
path: "/api/v1/shifts"
tags: ["Shifts"]
---

# Create a new shift

`POST /api/v1/shifts`

Create a new shift with the given details.

## Request body

- ShiftNew
  - `activities` ShiftActivity[], nullable — The activities that are linked to the shift
    - `activity_type_id` integer, required — The ID of the activity type
    - `end` string, date-time, required — The end time (UTC) of the activity e.g 2023-07-27 06:30:00+00
    - `id` union — The unique ID of the activity
      - integer
      - string
    - `notes` string, nullable — Notes for the activity
    - `shift_ids` integer[], nullable — List of shift IDs to which the activity is joined
    - `start` string, date-time, required — The start time (UTC) of the activity e.g 2023-07-27 06:30:00+00
  - `allow_alternative_times` boolean, nullable — Whether person can request changes to the timing of their shift
  - `approved` boolean, nullable — Whether timesheet associated with the shift has been approved
  - `archived` boolean, nullable — Whether shift has been archived
  - `auto_approve_changes` boolean, nullable — Whether shift change requests should be approved automatically
  - `cascade_` boolean, nullable — Whether to update joined objects that are linked to the shift
  - `client_ids` integer[], nullable — List of client IDs required for shift
  - `clock_in_time` string, date-time, nullable — The time when the person clocked in (UTC)
  - `clock_out_time` string, date-time, nullable — The time when the person clocked out (UTC)
  - `created_at_clock_in` boolean, nullable — Whether shift was created as a result of clocking-in
  - `end` string, date-time, required — The end time (UTC) of the shift e.g 2023-07-27 06:30:00+00
  - `flex_hours` boolean, nullable — Whether the shift has flexible hours
  - `is_publishing_calendar` boolean, nullable — Whether the shift is re-syncing to the user's calendar
  - `is_publishing_email` boolean, nullable — Whether the shift is re-sending email to the user
  - `is_publishing_slack` boolean, nullable — Whether the shift is re-publishing on slack
  - `is_publishing_sms` boolean, nullable — Whether the shift is re-sending sms to the user
  - `license_type_ids` integer[], nullable — List of license types IDs required for shift
  - `needs_publishing_calendar` boolean, nullable — Whether the shift needs syncing to the user's calendar
  - `needs_publishing_email` boolean, nullable — Whether the shift needs re-sending email to the user
  - `needs_publishing_slack` boolean, nullable — Whether the shift needs publishing on slack
  - `needs_publishing_sms` boolean, nullable — Whether the shift needs re-sending sms to the user
  - `notes` string, nullable — Any notes about the shift
  - `payment_id` integer, nullable — The ID of the payment associated with the shift
  - `people_required` integer, nullable — The number of people required for the shift if unassigned
  - `person_id` integer, nullable — The ID of the person assigned to the shift (if any)
  - `published_detail` object, nullable — Details the shift that was published
  - `recurrence_details` RecurrenceNew
    - `byday` string[], nullable — Days of week (MO, TU, WE, etc.)
    - `bymonth` integer[], nullable — Months
    - `bymonthday` integer[], nullable — Days of month
    - `count` integer, nullable — Number of occurrences
    - `exdate` string[], nullable — Exception dates
    - `freq` string, required — Frequency: DAILY, WEEKLY, MONTHLY, etc.
    - `id` integer, nullable — The ID of the recurrence
    - `interval` integer — How often the rule repeats
    - `original_recurrence_id` integer, nullable — The ID of the original recurrence that this recurrence is derived from
    - `reference_activity_id` integer, nullable — The ID of the activity that this recurrence is derived from
    - `reference_shift_id` integer, nullable — The ID of the shift that this recurrence is derived from
    - `tzid` string, nullable — Timezone identifier
    - `until` string, date-time, nullable — End date
  - `recurrence_id` integer, nullable — The ID of the recurrence the shift belongs to
  - `request_id` integer, nullable — ID of the request that created the shift
  - `role_id` integer, nullable — The ID of the role the shift belongs to (if any)
  - `shift_type_id` integer, nullable — The ID of the shift type
  - `start` string, date-time, required — The start time (UTC) of the shift e.g 2023-07-27 06:30:00+00
  - `status` string, nullable — The status of the shift
  - `team_id` integer, nullable — The ID of the team the shift belongs to (if any)
  - `time_published` string, date-time, nullable — When shift was last published

## Response `200`

Successful Response

- ShiftRead
  - `allow_alternative_times` boolean, nullable — Whether person can request changes to the timing of their shift
  - `approved` boolean, nullable — Whether timesheet associated with the shift has been approved
  - `archived` boolean, nullable — Whether shift has been archived
  - `auto_approve_changes` boolean, nullable — Whether shift change requests should be approved automatically
  - `created_at_clock_in` boolean, nullable — Whether shift was created as a result of clocking-in
  - `end` string, date-time, required — The end time (UTC) of the shift e.g 2023-07-27 06:30:00+00
  - `flex_hours` boolean, nullable — Whether the shift has flexible hours
  - `id` integer, required — The unique ID of the shift
  - `is_publishing_calendar` boolean, nullable — Whether the shift is re-syncing to the user's calendar
  - `is_publishing_email` boolean, nullable — Whether the shift is re-sending email to the user
  - `is_publishing_slack` boolean, nullable — Whether the shift is re-publishing on slack
  - `is_publishing_sms` boolean, nullable — Whether the shift is re-sending sms to the user
  - `needs_publishing_calendar` boolean, nullable — Whether the shift needs re-syncing to the user's calendar
  - `needs_publishing_email` boolean, nullable — Whether the shift needs re-sending email to the user
  - `needs_publishing_slack` boolean, nullable — Whether the shift needs re-publishing on slack
  - `needs_publishing_sms` boolean, nullable — Whether the shift needs re-sending sms to the user
  - `notes` string, nullable — Any notes about the shift
  - `organisation_id` integer, required — The ID of the organisation the shift belongs to
  - `payment_id` integer, nullable — The ID of the payment associated with the shift
  - `people_required` integer, nullable — The number of people required for the shift if unassigned
  - `person_id` integer, nullable — The ID of the person assigned to the shift (if any)
  - `recurrence_id` integer, nullable — The recurrence ID for the shift
  - `request_id` integer, nullable — ID of the request that created the shift
  - `role_id` integer, nullable — The ID of the role the shift belongs to
  - `rrule` string, nullable — The recurrence rule for the shift
  - `shift_type_id` integer, nullable — The ID of the shift type
  - `start` string, date-time, required — The start time (UTC) of the shift e.g 2023-07-27 06:30:00+00
  - `status` string, nullable — The status of the shift
  - `team_id` integer, nullable — The ID of the team the shift belongs to
  - `time_published` string, date-time, nullable — When shift was last published

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/joinplanbase/apis/planbase-api.md) · [All operations](https://skmtc.dev/joinplanbase/apis/planbase-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/joinplanbase/planbase-api/revisions/501c09a03cbc/schema)
