Skip to navigation

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, send week): a repeating weekly pattern. It replaces the whole current weekly pattern. week must have exactly 7 objects, each day once. dates is not allowed.
  • Flexible (type: flexible, send dates): 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. week is not allowed.
  • Each day or date has either shift_names (1 to 10 exact shift names from GET /attendance/shift, no repeats) or day_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 400 on salarybox_id; change it in the SalaryBox app.

Authentication

AuthorizationApi-Key

Format: “Api-Key {api-key}”

Request

This endpoint expects an object.
salarybox_idstringRequired1-50 characters
The staff member.
typeenumOptionalDefaults to fixed

fixed is a repeating weekly pattern (send week). flexible is a roster of specific dates (send dates; needs the Roster plan feature).

Allowed values:
weeklist of objectsOptional

Required when type is fixed; not allowed when flexible. Exactly 7 objects, one per day, each day once.

dateslist of objectsOptional

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.

messagestring
statusboolean
dataobject

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error