Planning
Create a shift
/v1/shiftsPlans employees on a creator: one series per employee, once or repeated, from today on (a past day is refused, 409 planning_day_in_past). Give named_shift_id, or start_time and end_time (HH:mm in the agency time zone; an end before the start ends the next day). The planning never gives access to the creator. Confirm with the user first; if the call gets no response, list the shifts before retrying (a blind retry creates a duplicate).
write:planningcurl -X POST 'https://api.fansquare.so/v1/shifts' \
-H "Authorization: Bearer $API_KEY" \
-H "Fansquare-Version: Amethyste" \
-H "Content-Type: application/json" \
-d '{
"creator_id": "m81IhLxdhzDGYs54rNp2",
"employee_ids": [
"9926b1f9-74a9-4ab5-a716-1c14f6bcc475"
],
"date": "string",
"named_shift_id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
"start_time": "string",
"end_time": "string",
"repeat": "none",
"week_days": [
"MO"
],
"until_date": "2026-10-12T21:14:00.000Z"
}'{
"data": [
{
"id": "40a6e358-bd2a-4cff-a59e-5709874d3f5b",
"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": [
"string"
],
"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.
Body
application/json
creator_idstringrequiredFansquare creator id (GET /v1/creators).
min length 1employee_idsarray of stringsrequiredWho works it: one series per employee (ids of GET /v1/planning/team).
min length 1min items 1max items 20datestringrequiredDay of the shift, or the first day of a repeated one.
pattern ^\d{4}-\d{2}-\d{2}$named_shift_idstringA named shift (GET /v1/named-shifts), instead of hours.
format uuidstart_timestringStart, HH:mm in the agency time zone.
pattern ^([01]\d|2[0-3]):[0-5]\d$end_timestringEnd, HH:mm in the agency time zone.
pattern ^([01]\d|2[0-3]):[0-5]\d$repeatstringnone(default),daily,weeklyorbiweekly.Valuesnonedailyweeklybiweeklyweek_daysarray of stringsDays of a weekly shift (default: the day of
date).ValuesMOTUWETHFRSASUmin items 1max items 7until_datestringLast day of the repetition, included. Omit for no end.
pattern ^\d{4}-\d{2}-\d{2}$
Response
Created, application/json
dataarray of objectsrequiredidstringrequiredSeries 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 POST 'https://api.fansquare.so/v1/shifts' \
-H "Authorization: Bearer $API_KEY" \
-H "Fansquare-Version: Amethyste" \
-H "Content-Type: application/json" \
-d '{
"creator_id": "m81IhLxdhzDGYs54rNp2",
"employee_ids": [
"9926b1f9-74a9-4ab5-a716-1c14f6bcc475"
],
"date": "string",
"named_shift_id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
"start_time": "string",
"end_time": "string",
"repeat": "none",
"week_days": [
"MO"
],
"until_date": "2026-10-12T21:14:00.000Z"
}'{
"data": [
{
"id": "40a6e358-bd2a-4cff-a59e-5709874d3f5b",
"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": [
"string"
],
"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"
}
]
}