FansquareAPI reference
Open the app

Planning

Change one day of a shift

POST/v1/shifts/{shift_id}/override

Another employee or other hours for one day only, today or later (the series keeps its other days). When an employee is absent all day, declare the absence with a replacement instead. Confirm with the user first.

Required scopewrite:planning
Rate limit30 requests per minute
curl -X POST 'https://api.fansquare.so/v1/shifts/e2ec62cd-6d60-4c5f-a1db-4112ca9ddc1a/override' \
  -H "Authorization: Bearer $API_KEY" \
  -H "Fansquare-Version: Amethyste" \
  -H "Content-Type: application/json" \
  -d '{
  "occurrence_date": "2026-10-12T21:14:00.000Z",
  "employee_id": "9926b1f9-74a9-4ab5-a716-1c14f6bcc475",
  "start_time": "string",
  "end_time": "string"
}'
{
  "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": [
    "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-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

  • occurrence_datestringrequired

    The occurrence_date of the day to change (GET /v1/shifts).

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

    Another employee that day only.

    min length 1
  • start_timestring

    Other start that day, HH:mm.

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

    Other end that day, HH:mm.

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

Response

Created, 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 POST 'https://api.fansquare.so/v1/shifts/e2ec62cd-6d60-4c5f-a1db-4112ca9ddc1a/override' \
  -H "Authorization: Bearer $API_KEY" \
  -H "Fansquare-Version: Amethyste" \
  -H "Content-Type: application/json" \
  -d '{
  "occurrence_date": "2026-10-12T21:14:00.000Z",
  "employee_id": "9926b1f9-74a9-4ab5-a716-1c14f6bcc475",
  "start_time": "string",
  "end_time": "string"
}'
{
  "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": [
    "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"
}