Skip to main content

Blocked Time Constraint

Hard constraint

Deprecated constraint

The Blocked Time Constraint has been replaced by the EmployeeAvailabilityConstraint (strict and undesired variant). It is not suggested at this time to integrate with it, and instead to wait for the new constraint to be released.

Specify time periods when employees cannot be scheduled to work, either through particular weekdays, dates or day indices. The constraint can also be configured to only apply to particular workTypes.

See the payload example below to get started and check out the API reference for full configurability of the constraint.

Payload example

The following defines a blocked time for employee 1 and 3 on Mondays, Wednesdays and Fridays between 09:00 and 17:00. This only applies to work type with ID 1.

{
"blockedTimeConstraints": [
{
"id": "btc-123",
"blockedTime": [
{
"scheduleDays": {
"weekDays": [1, 3, 5]
},
"startTime": "09:00",
"endTime": "17:00"
}
],
"workTypeIds": ["1"],
"employeeIds": ["1", "3"]
}
]
}
Blocked Time Constraint in the request payload
id
required
string (constraintId)

The id of the constraint should be UNIQUE in the context of constraint type.

required
Array of objects
workTypeIds
Array of strings (constraintWorkTypeIds) unique

List of workType IDs for which the constraint applies. The workTypeIds should be present in workType section. If work type ids are not specified, the constraint will be applied to all work types.

employeeIds
Array of strings (constraintEmployeeIds) unique

List of employee ids for which the constraint applies. The employee ids must be present in the employee section. If not specified, the constraint will be applied to all employees.

{
  • "id": "string",
  • "blockedTime": [
    ],
  • "workTypeIds": {
    },
  • "employeeIds": {
    }
}