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)
| Resource | Role |
|---|---|
| Workcycle | A recurring weekly pattern of working hours, assigned to employees via their V3 User’s userWorkcycles property. |
| Workcycle Exception | A one-time override of an employee’s working hours on a specific half-day. |
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)
| Resource | Role |
|---|---|
| Working Time Arrangement (WTA) | Replaces the Workcycle. Defines recurring working hours, contractual time, full-time equivalent, and associated rules. |
| Collective Schedule | The weekly hours pattern within a Working Time Arrangement (WTA) over a given date-range. A WTA can have successive collective schedules over time. |
| Employee Assignment | Links a Working Time Arrangement to an employee for a given period (via a work-contract amendment). |
| Shift Override | Replaces the Workcycle Exception. A one-time modification to an employee’s schedule on a specific day. |
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).
| Field | Meaning |
|---|---|
dtt | Theoretical working time — what the employee should work on that day. |
drt | Actual working time — what the employee actually worked (defaults to dtt if no time entry). |
draj | Leave duration — time absent via leaves. |
isHoliday | Whether the day is a public holiday. |
isWeeklyRest | Whether the day is a weekly rest day (e.g. Sunday). |
items[] | Detailed breakdown of all events for that day. |
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:| Unit | Meaning | Example |
|---|---|---|
| Day | Durations are expressed as fractions of a day. 12:00:00 = half a day. | ”I worked half a day” |
| Hour | Durations are expressed in hours. 03:30:00 = 3 hours and 30 minutes. | ”I worked 3h30” |
| Time | Durations are expressed in hours with a start time. | ”I worked from 09:00 to 12:30” |
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:Model comparison at a glance
| Aspect | Old Model | New Model |
|---|---|---|
| Base schedule | Workcycle | Working Time Arrangement + Collective Schedule |
| Assignment mechanism | V3 User userWorkcycles | Employee Assignment (creates work-contract amendment) |
| One-time override | Workcycle Exception | Shift Override |
| Override API style | POST individual exceptions | PUT replaces all overrides in a date range |
| Computed result | UserDate | UserDate |