Planning
Declare an absence
/v1/absencesAn employee is absent one day, today or later: their shifts that day go to the replacement, if one is given, otherwise they stay without anyone (see GET /v1/planning/coverage). One absence per employee and day. The replacement takes their shifts on every creator: a key limited to some creators cannot write absences (403 absence_needs_all_creators). Confirm with the user first.
write:planningcurl -X POST 'https://api.fansquare.so/v1/absences' \
-H "Authorization: Bearer $API_KEY" \
-H "Fansquare-Version: Amethyste" \
-H "Content-Type: application/json" \
-d '{
"employee_id": "9926b1f9-74a9-4ab5-a716-1c14f6bcc475",
"date": "string",
"kind": "absence",
"reason": "string",
"replacement_id": "03cef609-3d3c-42bd-a9e5-04182baf2362"
}'{
"id": "40a6e358-bd2a-4cff-a59e-5709874d3f5b",
"employee_id": "9926b1f9-74a9-4ab5-a716-1c14f6bcc475",
"date": "string",
"kind": "absence",
"replacement_id": "03cef609-3d3c-42bd-a9e5-04182baf2362",
"declared_by_self": true
}Parameters
Headers
Fansquare-VersionstringrequiredAPI version to pin. Accepts the mineral name or the release date of a version.
Body
application/json
employee_idstringrequiredThe absent employee (Fansquare user id).
min length 1datestringrequiredDay of the absence, in the agency time zone.
pattern ^\d{4}-\d{2}-\d{2}$kindstringabsence(default) orday_off.Valuesabsenceday_offreasonstring | nullReason, 200 characters at most. Written, never read back: it may be health data.
max length 200replacement_idstring | nullWho takes their shifts that day.
min length 1
Response
Created, application/json
idstringrequiredAbsence id.
employee_idstringrequiredFansquare user id.
datestringrequiredDay (YYYY-MM-DD), in the agency time zone.
kindstringrequiredabsenceorday_off.Valuesabsenceday_offreplacement_idstring | nullrequiredWho takes their shifts that day.
declared_by_selfbooleanrequiredThe employee declared it themselves.
curl -X POST 'https://api.fansquare.so/v1/absences' \
-H "Authorization: Bearer $API_KEY" \
-H "Fansquare-Version: Amethyste" \
-H "Content-Type: application/json" \
-d '{
"employee_id": "9926b1f9-74a9-4ab5-a716-1c14f6bcc475",
"date": "string",
"kind": "absence",
"reason": "string",
"replacement_id": "03cef609-3d3c-42bd-a9e5-04182baf2362"
}'{
"id": "40a6e358-bd2a-4cff-a59e-5709874d3f5b",
"employee_id": "9926b1f9-74a9-4ab5-a716-1c14f6bcc475",
"date": "string",
"kind": "absence",
"replacement_id": "03cef609-3d3c-42bd-a9e5-04182baf2362",
"declared_by_self": true
}