# Absence

Manage sick-leave registrations: list them, update their status
(e.g. mark as recovered), and read the full status history of a
single registration.


## Get sick leave status history

 - [GET /api/absence/v3/sick-leave/{sickLeaveRegistrationId}/status-history](https://beta-developer.dyflexis.com/openapi/absence/getsickleavestatushistory.md): Requires scope: absence.

Returns the full status transition history for a sick leave registration, ordered
chronologically (earliest first). Each entry represents a status change that occurred
during webhook processing or as reported by the external integration partner.

## List sick leave registrations

 - [GET /api/absence/v3/sick-leave](https://beta-developer.dyflexis.com/openapi/absence/listsickleaveregistrations.md): Requires scope: absence.

Returns a list of sick leave registrations.

## Report sick leave status

 - [POST /api/absence/v3/sick-leave/{sickLeaveRegistrationId}/status](https://beta-developer.dyflexis.com/openapi/absence/reportsickleavestatus.md): Requires scope: absence.

Report a status update for a sick leave registration. This endpoint is used by external
integration partners to report the processing status of a sick leave registration that
was sent via webhook.

The status transitions follow a state machine:
- in_progress, The registration is being processed by the external system.
- success, The registration was successfully processed (terminal state).
- failed, The registration failed to process. Can be retried by sending a new status.

Note: The initial statuses new and acknowledged are set automatically by Dyflexis
when the webhook is sent and received. Only in_progress, success, and failed
can be reported via this endpoint.

## Sick leave registration event

 - [POST sickLeaveRegistration](https://beta-developer.dyflexis.com/openapi/absence/sickleaveregistrationevent.md): > Webhook, Dyflexis sends this POST request to a URL you host. See the Webhooks guide for how to register your receiver and what it must return.

Sends a message when a sick leave registration is created or
recovered. Use the envelope field type to determine which
event you received:

- sick_leave_created, a new sick-leave registration has been
  filed.
- sick_leave_recovered, an existing registration has been
  closed because the employee recovered.

The webhook can't be registered with this API. Please register
this webhook in Dyflexis.

