Update Staff Schedule
Sets a staff member’s schedule, as the app’s schedule editor does. type is fixed (default) or flexible. Shared rules: see Writing data.
- Fixed (
type: fixed, sendweek): a repeating weekly pattern. It replaces the whole current weekly pattern.weekmust have exactly 7 objects, each day once.datesis not allowed. - Flexible (
type: flexible, senddates): a roster of specific dates; needs the Roster plan feature. It merges: only the dates sent change, every other rostered date keeps what it has. Send 1 to 60 dates, each at most once, from 60 days back to 60 days ahead of the staff member’s local today. A date up to today in a finalised payroll month is refused until payroll is unfrozen in the SalaryBox app.weekis not allowed. - Each day or date has either
shift_names(1 to 10 exact shift names fromGET /attendance/shift, no repeats) orday_off: true, never both and never neither. - More than one shift on any day or date needs the Multiple Shift Assignment plan feature.
- Switching type either way is allowed and starts a new schedule version, as in the app. Fixed to flexible leaves only the dates sent scheduled (other dates are unscheduled). Flexible to fixed replaces the roster with the weekly pattern.
- A fixed request for a staff member whose schedule changes by week of the month (for example alternate Saturdays) is refused with
400onsalarybox_id; change it in the SalaryBox app.
Authentication
Format: “Api-Key {api-key}”
Request
fixed is a repeating weekly pattern (send week). flexible is a roster of specific dates (send dates; needs the Roster plan feature).
Required when type is fixed; not allowed when flexible. Exactly 7 objects, one per day, each day once.
Required when type is flexible; not allowed when fixed. 1 to 60 dates, each at most once. Only these dates change; other rostered dates keep what they have. Dates may be up to 60 days ahead and 60 days back (local today of the staff member).
Response
The schedule was saved. A fixed request returns schedule_type: fixed with the full week; a flexible request returns schedule_type: flexible with the dates sent, in request order.
