Key concepts
An employee’s effective schedule (i.e.UserDate) on any given day is computed by layering three things, in order:
- Base recurring schedule — defines the default working hours for each day of the week (possibly alternating odd/even weeks).
- Public Holidays — days marked as non-working in the employee’s public-holidays calendar override the base schedule.
- One-time overrides — punctual modifications for a specific employee on a specific day (e.g. “exceptionally, this employee does not work next Thursday”).
Two co-existing models
The Schedule API is undergoing a major refactor. Depending on whether the Working Time Arrangements feature has been enabled on your Lucca environment, you will use one of two models (more below). Both produce the same end result (UserDates), but they differ in how the base schedule and overrides are represented.Old Model (Workcycles)
Workcycle
A workcycle is a theoretical recurring schedule assigned to an employee. It defines their working days and hours with a weekly (or bi-weekly) pattern. It is assigned to employees via the
userWorkcycles property of the V3 User.Workcycle Exception
A workcycle exception overrides the employee’s planned working hours on a specific half-day (AM or PM). Use it to add, remove, or change scheduled hours for one employee on one date.
New Model (Working Time Arrangements)
Working Time Arrangement
The successor to the Workcycle. Defines recurring working hours, the contractual working time duration, the full-time equivalent, and the public-holidays calendar for a population of employees.
Collective Schedule
Describes the actual weekly pattern of a Working Time Arrangement (e.g. “Monday to Friday, 09:00-17:00”) over a given date-range. Can be a single repeating week or alternate between odd and even weeks.
Employee Assignment
Assigns a Working Time Arrangement to an employee starting on a given date. Creating an assignment generates a work-contract amendment automatically.
Shift Override
A one-time modification to an employee’s regular schedule. Can mark a day as worked, off, part-time, or weekly rest, and optionally change the duration or start time.
The UserDate: reading the effective schedule
Regardless of which model you use, the UserDate resource gives you the final, computed schedule for one or more employees over a date range. It aggregates:- Theoretical hours from the base schedule (Workcycle or WTA).
- Public Holiday overrides from the employee’s holidays calendar.
- Exception / Shift Override modifications.
- Leaves from Lucca Absences (if applicable).
- Time entries from Lucca Timesheet (if applicable).
Understanding time units
Every schedule resource operates in one of three units. The unit is defined at the Workcycle or Working Time Arrangement level and determines how durations are expressed:Typical integration scenarios
Reading an employee’s schedule
To know what an employee is expected to work over a period, query the UserDate endpoint:Overriding an employee’s schedule for one day
Old Model — Create a Workcycle Exception:The Shift Override PUT endpoint uses replace semantics: all existing overrides for the employee within the
specified date range are removed and replaced with the ones you provide. To clear all overrides for a period,
send an empty array
[].Assigning a new schedule to an employee (New Model only)
To change the Working Time Arrangement assigned to an employee:1
End the employee’s current assignment on June 30th (the eve of the new start date).
2
Create a work-contract amendment effective July 1st with the new Working Time Arrangement.