---
title: "Update an existing shift swap"
method: PUT
path: "/api/v1/shift_swaps/{id}"
tags: ["Swaps"]
---

# Update an existing shift swap

`PUT /api/v1/shift_swaps/{id}`

Update an existing shift swap with the specified ID and details.

## Path parameters

- `id` integer, required — The ID of the shift_swap to update

## Request body

- ShiftSwapOptional
  - `archived` boolean, nullable — Whether the shift swap has been archived
  - `cancel_requested` boolean, nullable — Whether the shift swap has been requested to be cancelled
  - `end` string, date-time, nullable — The new proposed end time (UTC) of the shift e.g 2023-07-27 06:30:00+00
  - `find_replacement` boolean, nullable — Whether a replacement is needed to be found.
  - `group_id` string, nullable — The ID of the group the shift swap belongs to
  - `has_update_permission_` boolean, nullable — Temporary field to tell the client whether the person requesting the shift swap has update permissions
  - `id` integer, nullable — The unique ID of the shift swap
  - `notes` string, nullable — Notes
  - `offer_id` integer, nullable — The ID of the person who offered the shift
  - `offer_type` string, nullable — The type of change being requested
  - `publish_calendar` boolean, nullable — How person who made swap request should get notified when status changes
  - `publish_email` boolean, nullable — How person who made swap request should get notified when status changes
  - `publish_slack` boolean, nullable — How person who made swap request should get notified when status changes
  - `publish_sms` boolean, nullable — How person who made swap request should get notified when status changes
  - `reason` string, nullable — The reason for approving or denying a shift request
  - `shift_id` integer, nullable — The ID of the shift being swapped
  - `start` string, date-time, nullable — The new proposed start time (UTC) of the shift e.g 2023-07-27 06:30:00+00
  - `status` string, nullable — The status of the shift swap
  - `time_created` string, date-time, nullable — The time when the shift swap was created
  - `time_entries` ShiftNew[], nullable — Requested time entries
    - `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
  - `time_off_entries` UnavailabilityNew[], nullable — Requested time off entries
    - `archived` boolean, nullable — Whether time off entry has been archived
    - `end` string, date-time, required — The end time (UTC) of the unavailability e.g 2023-07-27 06:30:00+00
    - `exported` boolean, nullable — Whether this unavailability has been exported to payroll
    - `external_ids` object, nullable — External system IDs mapping (e.g. {'adp': '123', 'healthie': '456'})
    - `is_publishing_calendar` boolean, nullable — Whether the unavailability is publishing to the user's calendar
    - `make_up_time` string, date-time, nullable — The time the unavailability needs to be worked at another time
    - `needs_publishing_calendar` boolean, nullable — Indicates if the unavailability needs publishing
    - `organisation_id` integer, nullable — The ID of the organisation the unavailability belongs to
    - `person_id` integer, required — The ID of the person the unavailability belongs to
    - `request_id` integer, nullable — The ID of the request that created the unavailability
    - `start` string, date-time, required — The start time (UTC) of the unavailability e.g 2023-07-27 06:30:00+00
    - `status` string, nullable — The status of the time off entry
    - `unavailability_type_id` integer, required — The ID of the unavailability type
  - `time_updated` string, date-time, nullable — The time when the shift swap was last updated
  - `value` number, nullable — The value of the shift swap

## Response `200`

Successful Response

- ShiftSwap
  - `archived` boolean, nullable — Whether the shift swap has been archived
  - `cancel_requested` boolean, nullable — Whether the shift swap has been requested to be cancelled
  - `end` string, date-time, nullable — The new proposed end time (UTC) of the shift e.g 2023-07-27 06:30:00+00
  - `find_replacement` boolean, nullable — Whether a replacement is needed to be found.
  - `group_id` string, nullable — The ID of the group the shift swap belongs to
  - `id` integer, required — The unique ID of the shift swap
  - `notes` string, nullable — Notes
  - `offer_id` integer, required — The ID of the person who offered the shift
  - `offer_type` string, required — The type of change being requested
  - `publish_calendar` boolean, nullable — How person who made swap request should get notified when status changes
  - `publish_email` boolean, nullable — How person who made swap request should get notified when status changes
  - `publish_slack` boolean, nullable — How person who made swap request should get notified when status changes
  - `publish_sms` boolean, nullable — How person who made swap request should get notified when status changes
  - `reason` string, nullable — The reason for approving or denying a shift request
  - `shift_id` integer, nullable — The ID of the shift being swapped
  - `start` string, date-time, nullable — The new proposed start time (UTC) of the shift e.g 2023-07-27 06:30:00+00
  - `status` string, nullable — The status of the shift swap
  - `time_created` string, date-time, required — The time when the shift swap was created
  - `time_updated` string, date-time, required — The time when the shift swap was last updated
  - `value` number, nullable — The value of the shift swap

## 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)
