See Schedules in the manual.
List schedules
hr.schedules
Deleted schedules are not listed.
Get a schedule
hr.schedules
Returns the same object.
Create a schedule
hr.schedules.write
Behavior
- A day can have several shifts, but they cannot overlap.
- Legal warnings (
warnings) do not prevent saving.
201 response: the created schedule.
Edit a schedule
hr.schedules.write
Send only the fields that change. If you send shifts, it replaces all shifts.
200 response: the schedule with recalculation_queued (true if attendance recalculation was queued for the employees who have it assigned).
Delete a schedule
hr.schedules.write
409 if the schedule has current assignments (no end date, or an end date of today or later): end them or change them first.
Get assignments
hr.schedules
end_date: null = open-ended assignment.
Assign a schedule in bulk
hr.schedules.write
Assigns a schedule to several employees with the same validity period.
Behavior
- Idempotent: if the employee already has an assignment that starts on
start_date, it is updated instead of duplicated. - An assignment that overlaps another one of the employee is rejected (unless
close_previouscloses it). - Each employee is processed separately: an error does not stop the rest.
200 response
422. If the schedule does not exist, 404.
Error messages for already-resolved employees (for example, overlaps) come in Spanish, with
employee_id populated.Delete an assignment
hr.schedules.write