FansquareAPI reference
Open the app

Planning

Change a series of shifts

PATCH/v1/shifts/{shift_id}

Changes the whole series: employee, hours, days, last day. A series that started before today only changes its last day (409 shift_series_started), today or later (409 planning_day_in_past): to change it from a day on, end it from that day (DELETE with scope following) and create the new shift from that day. Confirm with the user first.

Required scopewrite:planning
Rate limit30 requests per minute
curl -X PATCH 'https://api.fansquare.so/v1/shifts/e2ec62cd-6d60-4c5f-a1db-4112ca9ddc1a' \
  -H "Authorization: Bearer $API_KEY" \
  -H "Fansquare-Version: Amethyste" \
  -H "Content-Type: application/json" \
  -d '{
  "employee_id": "9926b1f9-74a9-4ab5-a716-1c14f6bcc475",
  "named_shift_id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
  "start_time": "string",
  "end_time": "string",
  "week_days": [
    "MO"
  ],
  "until_date": "2026-10-12T21:14:00.000Z"
}'
{
  "id": "e2ec62cd-6d60-4c5f-a1db-4112ca9ddc1a",
  "creator_id": "m81IhLxdhzDGYs54rNp2",
  "employee_id": "9926b1f9-74a9-4ab5-a716-1c14f6bcc475",
  "starts_at": "2026-10-12T21:14:00.000Z",
  "ends_at": "2026-10-12T21:14:00.000Z",
  "timezone": "Europe/Paris",
  "repeat": "none",
  "week_days": [
    "MO"
  ],
  "until": "2026-10-12T21:14:00.000Z",
  "named_shift_id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
  "from_work_profile": true,
  "replaces_shift_id": "29249479-15d7-43cf-ad43-e93d0d2f1c9b"
}

Parameters

Headers

  • Fansquare-Versionstringrequired

    API version to pin. Accepts the mineral name or the release date of a version.

Path

  • shift_idstringrequired

    Series id (shift_id).

    format uuid

Body

application/json

  • employee_idstring

    Another employee for the whole series.

    min length 1
  • named_shift_idstring

    A named shift, instead of hours.

    format uuid
  • start_timestring

    New start, HH:mm.

    pattern ^([01]\d|2[0-3]):[0-5]\d$
  • end_timestring

    New end, HH:mm.

    pattern ^([01]\d|2[0-3]):[0-5]\d$
  • week_daysarray of strings

    New days of a weekly series.

    ValuesMOTUWETHFRSASUmin items 1max items 7
  • until_datestring | null

    New last day (included), null to remove the end.

    pattern ^\d{4}-\d{2}-\d{2}$

Response

OK, application/json

  • idstringrequired

    Series id (shift_id).

  • creator_idstringrequired

    Fansquare creator id.

  • employee_idstringrequired

    Fansquare user id.

  • starts_atstringrequired

    Start of its first shift (ISO 8601).

    format date-time
  • ends_atstringrequired

    End of its first shift (ISO 8601).

    format date-time
  • timezonestringrequired

    The time zone of the rule (the agency time zone when it was set).

  • repeatstringrequired

    none, daily, weekly, biweekly, monthly or yearly.

  • week_daysarray of strings | nullrequired

    Days of a weekly series, in its time zone.

  • untilstring | nullrequired

    End of the series (excluded), null without end.

    format date-time
  • named_shift_idstring | nullrequired

    The named shift it comes from.

  • from_work_profilebooleanrequired

    Made by a work profile.

  • replaces_shift_idstring | nullrequired

    A one-day change: the series whose day it replaces.

curl -X PATCH 'https://api.fansquare.so/v1/shifts/e2ec62cd-6d60-4c5f-a1db-4112ca9ddc1a' \
  -H "Authorization: Bearer $API_KEY" \
  -H "Fansquare-Version: Amethyste" \
  -H "Content-Type: application/json" \
  -d '{
  "employee_id": "9926b1f9-74a9-4ab5-a716-1c14f6bcc475",
  "named_shift_id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
  "start_time": "string",
  "end_time": "string",
  "week_days": [
    "MO"
  ],
  "until_date": "2026-10-12T21:14:00.000Z"
}'
{
  "id": "e2ec62cd-6d60-4c5f-a1db-4112ca9ddc1a",
  "creator_id": "m81IhLxdhzDGYs54rNp2",
  "employee_id": "9926b1f9-74a9-4ab5-a716-1c14f6bcc475",
  "starts_at": "2026-10-12T21:14:00.000Z",
  "ends_at": "2026-10-12T21:14:00.000Z",
  "timezone": "Europe/Paris",
  "repeat": "none",
  "week_days": [
    "MO"
  ],
  "until": "2026-10-12T21:14:00.000Z",
  "named_shift_id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
  "from_work_profile": true,
  "replaces_shift_id": "29249479-15d7-43cf-ad43-e93d0d2f1c9b"
}