Planning
Change a series of shifts
/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.
write:planningcurl -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-VersionstringrequiredAPI version to pin. Accepts the mineral name or the release date of a version.
Path
shift_idstringrequiredSeries id (
shift_id).format uuid
Body
application/json
employee_idstringAnother employee for the whole series.
min length 1named_shift_idstringA named shift, instead of hours.
format uuidstart_timestringNew start, HH:mm.
pattern ^([01]\d|2[0-3]):[0-5]\d$end_timestringNew end, HH:mm.
pattern ^([01]\d|2[0-3]):[0-5]\d$week_daysarray of stringsNew days of a weekly series.
ValuesMOTUWETHFRSASUmin items 1max items 7until_datestring | nullNew last day (included), null to remove the end.
pattern ^\d{4}-\d{2}-\d{2}$
Response
OK, application/json
idstringrequiredSeries id (
shift_id).creator_idstringrequiredFansquare creator id.
employee_idstringrequiredFansquare user id.
starts_atstringrequiredStart of its first shift (ISO 8601).
format date-timeends_atstringrequiredEnd of its first shift (ISO 8601).
format date-timetimezonestringrequiredThe time zone of the rule (the agency time zone when it was set).
repeatstringrequirednone, daily, weekly, biweekly, monthly or yearly.
week_daysarray of strings | nullrequiredDays of a weekly series, in its time zone.
untilstring | nullrequiredEnd of the series (excluded), null without end.
format date-timenamed_shift_idstring | nullrequiredThe named shift it comes from.
from_work_profilebooleanrequiredMade by a work profile.
replaces_shift_idstring | nullrequiredA 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"
}