Creating or updating an absence

Copy
Note - Absences include Holidays, Sickness, Study/Exam etc.

Models

Absence

Copy
{
  "Id": <guid>,
  "EmployeeId": <guid>,
  "AbsenceReasonId": <guid>,
  "Narrative": <string>,
  "StartDate": <date>,
  "EndDate": <date>
}

The Absence represents the whole absence. It has a link to an employee and an Absence Reason. There is a Start and End Date. The narrative is optional.

AbsenceDay

Copy
{
  "Id": <guid>,
  "AbsenceId": <guid>,
  "Date": <date>,
  "DurationDays": <decimal>,
  "DurationMinutes": <int>,
  "DayPart": <AM|PM|AllDay|None>
}

The Absence Day is a single day within the Absence. There is a collection of Absence Days where the duration is not zero.

Absence Endpoint

Create Absence

Copy
POST https://api.iris.co.uk/attendance/absences

The employee and absence reason must exist. The absence reason must also be supported.

Update Absence

Copy
PUT https://api.iris.co.uk/attendance/absences/{id}

You can only update the dates. The system deletes any existing Absence Days outside of the new start/ end dates.

Create Absence Day

Copy
POST https://api.iris.co.uk/attendance/absencedays

The Absence Id is required and must exist. The Employee Id is not required and is read-only via the Employee Id on the Absence. The duration is required, refer to Absence Day Duration for more details. To set the Absence Day to zero duration, delete the Absence Day.

Update Absence Day

Copy
PUT https://api.iris.co.uk/attendance/absencedays/{id}

You can only update the duration and day part. Refer to Absence Day Duration for details.

Optional Query Parameters

Create Absence

POST https://api.iris.co.uk/hr/v2/attendance/absences?autoGenerateDaysBasedOnWorkingPattern=true

Update Absence

PUT https://api.iris.co.uk/hr/v2/attendance/absences?autoGenerateDaysBasedOnWorkingPattern=true

The current behaviour when creating an absence is to submit the main absence information on the /Absences endpoint and use the/AbsenceDays endpoint to submit the days.

We recognise on some occasions you may not be aware of the employee's working pattern. In this case, add ?autoGenerateDaysBasedOnWorkingPattern=true on the end of the your POST / PUT request.

When provided as true, you do not need to submit anything to the /AbsenceDays endpoint. Absence Days automatically populate based on the employee's working pattern.

If your absence includes half-days or a custom duration that is not a full day, do not use this option. This feature does not account for that and would create the absence as a full day. If this applies, use the Optional Query Parameters on the /AbsenceDays endpoint instead.

Because the days are auto-generated based on the employee’s working pattern, the Absence Days do not appear in the API immediately.This data will SYNC back up to the API within 20 minutes of the initial POST/PUT request.

If you need to query the absence days after the 20 minutes, use GET https://api.iris.co.uk/hr/v2/attendance/absencedays?$filter=AbsenceId eq '[ID from Absence]'

Create AbsenceDay

POST https://api.iris.co.uk/hr/v2/attendance/absencedays?skipNonWorkingDays=true

When submitting days to the /AbsenceDays endpoint, the values you submit are added to the absence by default, even if they fall on a non-working day.

If you include ?skipNonWorkingDays=true at the end of your POST request, the system checks the employee's working pattern before committing the data. If the working pattern shows it is a non- working day, the duration sets to 0, ensuring the employee's planner remains as a non-working day. Any entitlement will not deduct for non-working days.

If IRIS Cascade, treats the created Absence Day as a non-working day, the API will remove it.