Skip to main content
The Fill API request defines employees, shifts, and constraints for workforce scheduling optimization.

Request Structure

Top-Level Fields

shifts
array
required
List of shifts to be filled with employees. See Shift.
employees
array
required
List of available employees. See Employee.
rules
array
Labor rules and constraints. See Rule.
requirements
array
Skill requirements across shifts. See Requirement.
fairnessBuckets
array
Workload distribution groups. See FairnessBucket.
rests
array
Rest period constraints. See Rest.
patterns
array
Shift sequence patterns. See Pattern.
demands
array
Coverage requirements. See Demand.
assignments
array
Pre-assigned employee-shift pairs. See Assignment.
options
object
Solver configuration. See Options.
weights
object
Custom constraint weights. See Weights.
hook
string (URI)
Webhook URL for completion notification.
label
string
Label to identify the request (e.g. end customer id). Max 255 characters.
metadata
object
Optional metadata for tracking purposes (e.g. customerId, appId, userId). Max 10 entries.

Shift

Shifts represent time slots that need employees assigned.
name
string
required
Unique identifier for the shift.
from
datetime
required
Shift start time (ISO 8601 format).
to
datetime
required
Shift end time (ISO 8601 format).
skills
array
Required skill references. Employees must have matching skills.
min
integer
required
Minimum employees required for this shift.
max
integer
required
Maximum employees allowed for this shift.
priority
integer
Shift importance; the solver’s penalty for leaving the shift unassigned scales with this value, so a higher value means higher priority (more likely to be filled). Must be ≥ 0. No fixed upper bound.
tags
array
Shift tags for grouping in rules and patterns. See ShiftTag.
blocklist
array
Employee names that cannot be assigned to this shift.
cost
number
Financial cost for assigning this shift. Minimized in partial planning.
location
object
Geographic location of the shift ({lat, lon}). Used with an employee’s home location to optimize/penalize travel time.
rests
array
Rest requirements after this shift. See Rest.

ShiftTag

name
string
required
Tag identifier used in rules and patterns.

Employee

Employees are the workforce available for shift assignments.
name
string
required
Unique identifier for the employee.
skills
array
Employee capabilities. Each skill has a name, optional weight (proficiency), and optional expiry date.
availability
array
Available time ranges (ISO 8601 interval format).
preference
array
Preferred shift names.
contracts
array
List of employee contracts (working-time limits, shift-length limits, etc.).
home
object
Home location of the employee; the solver optimizes total travel time.
hourlyPay
number
Hourly pay of the employee; the solver optimizes planning cost.
periodRules
array
Rules scoped to a specific period, overriding contract defaults for that period.

Rule

Rules define labor constraints using counters or sequences.
constraint
string
required
Rule type: COUNTER or SEQUENCE.
type
string
required
What to measure: DAYS_WORKED, DAYS_IDLE, WEEKENDS_WORKED, WEEKENDS_IDLE, SHIFT_TYPES_WORKED, SHIFT_TYPES_HOURS_WORKED, HOURS_WORKED, MAX_CONSECUTIVE_DAYS.
min
integer
Minimum count or sequence length.
max
integer
Maximum count or sequence length.
At least one of min or max must be provided; a Rule cannot omit both.
period
object
Time scope with from/to or rolling duration.
shifts
array
Filter to specific shift tags.
then
Rule
Conditional rule triggered when threshold exceeded.

Requirement

Skill requirements across multiple shifts.
shifts
array
required
Shift names this requirement applies to.
skill
string
required
Required skill name.
value
integer
required
Number of employees with this skill required.

FairnessBucket

Groups for equitable workload distribution.
employees
array
required
Employees in this fairness group.
shifts
array
required
Shifts to distribute fairly.
period
object
Evaluation period with from and to dates.
target
string (ISO 8601 duration)
required
Target workload per employee.

Pattern

Shift sequence preferences or restrictions.
type
string
required
SINGLE_DAY or MULTI_DAY.
satisfy
string
required
PREFERRED, UNPREFERRED, or PROHIBITED.
elements
array
Sequence elements with type (ON/OFF) and tags (tag list).
weight
integer
Priority weight for preferred patterns.

Demand

Coverage requirements independent of shifts.
name
string
required
Unique demand identifier.
from
datetime
required
Demand period start.
to
datetime
required
Demand period end.
skills
array
required
Required skills for this demand period.
min
integer
Minimum employees required.
max
integer
Maximum employees allowed.

Assignment

Pre-defined employee-shift pairings.
shift
string
required
Shift name to assign.
employee
string
required
Employee name to assign.
locked
boolean
default:"false"
If true, the solver cannot change this assignment.

Options

Solver configuration settings.
hardAvailability
boolean
default:"true"
Enforce availability as hard constraint.
hardSkill
boolean
default:"true"
Enforce skill matching as hard constraint.
hardBlacklist
boolean
default:"true"
Enforce blocklist as hard constraint.
partialPlanning
boolean
default:"false"
Allow unfilled shifts in solution.
penaliseZeroHours
boolean
Penalize employees with no assignments.
explanation
object
Explanation settings. See ExplanationOptions.
idleWeekend
object
Weekend definition. See IdleWeekendDefinition.
useAvailabilityLocations
boolean
Whether to use the location on employee availability windows when computing travel time.
alwaysScoreSharedSkills
boolean
Whether to always score shared skill requirements, even when not otherwise triggered.

ExplanationOptions

enabled
boolean
default:"false"
Enable alternative generation.
filterHardConstraints
boolean
default:"false"
Exclude infeasible alternatives from response.
onlyUnassigned
boolean
default:"false"
Compute alternatives only for unassigned shifts.

IdleWeekendDefinition

fromDayOfWeek
string
required
Weekend start day.
fromTime
string
required
Weekend start time (HH:mm:ss).
toDayOfWeek
string
required
Weekend end day.
toTime
string
required
Weekend end time (HH:mm:ss).
restTime
string (ISO 8601 duration)
Minimum consecutive rest for idle weekend.

Rest

Rest period constraints.
tags
array
Shift tags that trigger this rest.
excludes
array
Shift tags excluded from rest calculation.
sequence
string
AFTER, BEFORE, or CUMULATIVE relative to the triggering shift.
period
object
Fixed period for periodic rest rules.
periodType
string
Rolling period: WEEKLY, DAILY.
min
string (ISO 8601 duration)
Minimum total rest.
max
string (ISO 8601 duration)
Maximum total rest.
minConsecutive
string (ISO 8601 duration)
Minimum uninterrupted rest.
frequency
integer
Maximum rest occurrences.