FansquareAPI reference
Open the app

Planning

Set the work profile of an employee

PUT/v1/planning/team/{employee_id}/work-profile

Replaces the weekly hours and the creators of an employee. From today, their profile shifts follow: the old ones stop tonight, one weekly series per hours and creator starts today. Shifts set by hand do not move. The planning never gives access to a creator. Confirm with the user first.

Required scopewrite:planning
Rate limit30 requests per minute
curl -X PUT 'https://api.fansquare.so/v1/planning/team/9926b1f9-74a9-4ab5-a716-1c14f6bcc475/work-profile' \
  -H "Authorization: Bearer $API_KEY" \
  -H "Fansquare-Version: Amethyste" \
  -H "Content-Type: application/json" \
  -d '{
  "slots": [
    {
      "named_shift_id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
      "start_time": "string",
      "end_time": "string",
      "week_days": [
        "MO"
      ]
    }
  ],
  "creator_ids": [
    "m81IhLxdhzDGYs54rNp2"
  ]
}'
{
  "slots": [
    {
      "named_shift_id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
      "start_time": "string",
      "end_time": "string",
      "week_days": [
        "MO"
      ]
    }
  ],
  "creator_ids": [
    "m81IhLxdhzDGYs54rNp2"
  ]
}

Parameters

Headers

  • Fansquare-Versionstringrequired

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

Path

  • employee_idstringrequired

    Fansquare user id.

    min length 1max length 128

Body

application/json

  • slotsarray of objectsrequired

    The whole weekly profile (it replaces the current one). Empty: no hours any more.

    max items 12
    • named_shift_idstring

      A named shift.

      format uuid
    • start_timestring

      Without named_shift_id: start, HH:mm (agency time).

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

      Without named_shift_id: end, HH:mm (agency time).

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

      Days of these hours.

      ValuesMOTUWETHFRSASUmin items 1max items 7
  • creator_idsarray of stringsrequired

    The creators of the profile, all of them.

    min length 1max items 100

Response

OK, application/json

  • slotsarray of objectsrequired

    The saved hours.

    • named_shift_idstring | nullrequired

      A named shift, or null for hours given directly.

    • start_timestringrequired

      Start, HH:mm.

    • end_timestringrequired

      End, HH:mm.

    • week_daysarray of stringsrequired

      Days of these hours: MO, TU, WE, TH, FR, SA, SU.

  • creator_idsarray of stringsrequired

    The saved creators.

curl -X PUT 'https://api.fansquare.so/v1/planning/team/9926b1f9-74a9-4ab5-a716-1c14f6bcc475/work-profile' \
  -H "Authorization: Bearer $API_KEY" \
  -H "Fansquare-Version: Amethyste" \
  -H "Content-Type: application/json" \
  -d '{
  "slots": [
    {
      "named_shift_id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
      "start_time": "string",
      "end_time": "string",
      "week_days": [
        "MO"
      ]
    }
  ],
  "creator_ids": [
    "m81IhLxdhzDGYs54rNp2"
  ]
}'
{
  "slots": [
    {
      "named_shift_id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
      "start_time": "string",
      "end_time": "string",
      "week_days": [
        "MO"
      ]
    }
  ],
  "creator_ids": [
    "m81IhLxdhzDGYs54rNp2"
  ]
}