Create Staff Schedule

Recurrences

Recurrences are embedded into Schedules and Substitutions and define how something recurs over time.
There are three types of recurrences supported:

  • Occurrence
  • Repeat
  • Periodic

Occurrence

Used for shiftSubstitution. Occurrence defines specific dates on which a configuration occurs.

"recurrence": {
  "type": "occurrence"
  "datesApplicable": {
    "from": "2024-09-24",
    "to": "2024-09-30"
  }
},

Repeat

Used for staffSchedule. Repeat defines a period of time over which a configuration occurs. "To" is optional and if omitted occurs infinitely.

"recurrence": {
  "type": "repeat"
  "datesApplicable": {
    "from": "2024-09-24",
    "to": "2024-09-30"
  }
},

Periodic

Used for staffSchedule. Periodic, similar to repeat, defines a period of time over which a configuration occurs. However, periodic may occur "ever other" or "every n" times.

"recurrence": {
  "type": "periodic"
  "datesApplicable": {
    "from": "2024-09-24",
    "to": "2024-09-30"
  }
},
  • When listing all staff schedule the query parameter filter[fieldName] supports filtering response with the following fields,

    • id
    • accountId
    • calendarId
    • createdId
    • createdName
    • escalationOption
    • lastModifiedName
    • minStaff
    • name
    • organizationId
    • recurrence.type
    • recurrence.datesApplicable.from
    • recurrence.datesApplicable.to
    • recurrence.everyNRecurrence
    • onCallReminder.enabled
    • resourceBundleId
    • seq
    • sequencingOverrideAllowed
    • shiftScheduleId
    • staffAssignments.type
    • staffEachDay
    • status

    Example Usage: filter[calendarId]

  • While creating non-periodic staff schedule or staff schedule for all days of the week set the data.recurrence.repeat to repeat

Staff Assignments

Staff Assignments are embedded into StaffSchedule, ShiftSubstitution, and staffSubstitution to define who is staffed.

Contact

Staff specifies a set of contact IDs.

{
  "type": "contact",
  "days": [2, 3, 4, 5, 6],
  "contactIds": [1111, 22222, 33333]
}

Group

Staff specifies a set of groupIDs.

{
  "type": "group",
  "days": [3],
  "groupIds": [33, 333, 33333]
}

Mixed

Mixed permits a combination of group and staff. It could be used to specify contactIDs or groupIDs only.

{
  "type": "mixed",
  "ids": [
    {
      "id": 44,
      "type": "contact"
    },
    {
      "id": 4444,
      "type": "group"
    }
  ],
  "days": [4]
}

iCal

Used for substitions or staffSchedule rotation. Defines a recurrence based upon the iCal standard.

See RFC 2445 and the recurrence rule below,

{
  "recurrence": {
    "type": "ical",
    "rule": "FREQ=WEEKLY;WKST=MO;BYDAY=MO,TU,TH",
    "datesApplicable": {
      "from": "2017-02-01"
    }
  }
}

Fields

NameRequired?Data Type?Description
rruleystringA valid iCal RRULE expression.
datesApplicable.fromyDate (YYYY-MM-DD)The start date of the recurrence.
datesApplicable.tonDate (YYYY-MM-DD)If specified, indicates the end date of the recurrence. If omitted, the recurrence either never ends or the RRULE may indicate the end date.

4.3.10 Recurrence Rule

Staff Rotation

ParameterData TypeDescription
numberOfStaffOnCallintegerThe number of staff who are on call for the rotation. For example, 10 contacts are in the rotation, but 2 are always on call.
numberOfStaffToRotateintegerThe number of staff who are rotated. For example, if there are 3 contacts on call and 2 are rotated, 1 of the staff remains on call for the next rotation.
numIntervalsintegerThe number of days in a single recurrence.
rotationDirectionstringDefines the direction in which staff are rotated. For example, with numberOfStaffToRotate=1 the first on call may shift to the end of the rotation or may shift to the second in rotation.

Request Body

PropertyDescription
calendarIdShould be valid calendar ID
shiftScheduleIdShould be related to calender ID. More info will be added here
staffAssignmentsShould be related to calender ID. More info will be added here
datesApplicable.fromThis start date should not be prior to the start date of associated Shift Schedule Id
Language
Credentials
URL
Click Try It! to start a request and see the response here!