1. Home
  2. Docs
  3. Schedule Enforcement
  4. Check for Scheduled Shifts
  5. Setting the Grace Period

Setting the Grace Period

The grace period is an interval defined in minutes that specifies the time window between now and the X defined number of minutes into the future within which 7shifts should look for scheduled shifts for the user.

Consider a shift that is scheduled to start at 4:00 PM and end at 5:00 PM, as an example. Setting different lengths of grace periods will have the following effects on clocking in at the shown example times (i.e., will return a shift to determine whether user should be allowed to clock in):


Clocking in at
Grace period duration (in minutes)
0
15
30
60
2:58 PM
NoNoNoNo
3:10 PM
NoNoNoYes
3:29 PM
NoYesNoYes
3:59 PM
NoYesYesYes
4:00 PM
YesYesYesYes
4:24 PM
YesYesYesYes
5:06 PM
NoNoNoNo

Since the grace_period field will need to be specified in the request body, you will need to create a setting in the UI which will allow the admin in your system to define this grace period. You can then use this saved setting value from your system for every request you make to the /shifts/scheduled endpoint.

A few things to note about the grace period:

  • This grace period only exists within the context of each individual request, so it must be specified in the body of every request
  • If the current time of making the request is already past the starting time of the shift, but the shift still hasn’t ended, the shift will be returned in the response no matter what you set the grace period to
  • The grace period cannot be defined any higher than 60 minutes