FansquareAPI reference
Open the app

Planning

Change an absence

PATCH/v1/absences/{absence_id}

Sets or removes the replacement, the kind or the reason of an absence of today or later. Needs a key for all creators. Confirm with the user first.

Required scopewrite:planning
Rate limit30 requests per minute
curl -X PATCH 'https://api.fansquare.so/v1/absences/88bd19bf-d104-4593-abd4-ce4145aba3ca' \
  -H "Authorization: Bearer $API_KEY" \
  -H "Fansquare-Version: Amethyste" \
  -H "Content-Type: application/json" \
  -d '{
  "kind": "absence",
  "reason": "string",
  "replacement_id": "03cef609-3d3c-42bd-a9e5-04182baf2362"
}'
{
  "id": "88bd19bf-d104-4593-abd4-ce4145aba3ca",
  "employee_id": "9926b1f9-74a9-4ab5-a716-1c14f6bcc475",
  "date": "2026-10-12",
  "kind": "absence",
  "replacement_id": "03cef609-3d3c-42bd-a9e5-04182baf2362",
  "declared_by_self": true
}

Parameters

Headers

  • Fansquare-Versionstringrequired

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

Path

  • absence_idstringrequired

    Absence id.

    format uuid

Body

application/json

  • kindstring

    absence or day_off.

    Valuesabsenceday_off
  • reasonstring | null

    Reason, null to remove it.

    max length 200
  • replacement_idstring | null

    Who takes their shifts, null for nobody.

    min length 1

Response

OK, application/json

  • idstringrequired

    Absence id.

  • employee_idstringrequired

    Fansquare user id.

  • datestringrequired

    Day (YYYY-MM-DD), in the agency time zone.

  • kindstringrequired

    absence or day_off.

    Valuesabsenceday_off
  • replacement_idstring | nullrequired

    Who takes their shifts that day.

  • declared_by_selfbooleanrequired

    The employee declared it themselves.

curl -X PATCH 'https://api.fansquare.so/v1/absences/88bd19bf-d104-4593-abd4-ce4145aba3ca' \
  -H "Authorization: Bearer $API_KEY" \
  -H "Fansquare-Version: Amethyste" \
  -H "Content-Type: application/json" \
  -d '{
  "kind": "absence",
  "reason": "string",
  "replacement_id": "03cef609-3d3c-42bd-a9e5-04182baf2362"
}'
{
  "id": "88bd19bf-d104-4593-abd4-ce4145aba3ca",
  "employee_id": "9926b1f9-74a9-4ab5-a716-1c14f6bcc475",
  "date": "2026-10-12",
  "kind": "absence",
  "replacement_id": "03cef609-3d3c-42bd-a9e5-04182baf2362",
  "declared_by_self": true
}