Skip to main content
POST
/
v2
/
fill
/
solve
Solve
curl --request POST \
  --url https://api.solvice.io/v2/fill/solve \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "employees": [
    {
      "name": "<string>",
      "home": {
        "lat": 123,
        "lon": 123
      },
      "availability": [
        {
          "from": "2023-11-07T05:31:56Z",
          "to": "2023-11-07T05:31:56Z",
          "location": {
            "lat": 123,
            "lon": 123
          }
        }
      ],
      "preference": [
        "<string>"
      ],
      "skills": [
        {
          "name": "<string>",
          "expiry": "2022-03-10",
          "weight": 123,
          "period": {
            "from": "2022-03-10T12:15:50",
            "to": "2022-03-10T12:15:50",
            "duration": "<string>",
            "period": "<string>",
            "excludes": [
              "2023-12-25"
            ],
            "type": "DAILY"
          }
        }
      ],
      "hourlyPay": 123,
      "efficiency": 123,
      "periodRules": [
        {
          "period": {
            "from": "2022-03-10T12:15:50",
            "to": "2022-03-10T12:15:50",
            "duration": "<string>",
            "period": "<string>",
            "excludes": [
              "2023-12-25"
            ],
            "type": "DAILY"
          },
          "maxWorkingDays": 123,
          "minWorkingDays": 123,
          "minWorkingDuration": "<string>",
          "maxWorkingDuration": "<string>",
          "minRestDurationBetweenShiftsSameDay": "<string>",
          "minRestDuration": "<string>",
          "maxShiftLength": "<string>",
          "minShiftLength": "<string>",
          "latestShiftStart": "<string>",
          "earliestShiftStart": "<string>",
          "latestShiftEnd": "<string>",
          "minWeekendsIdle": 123,
          "maxWeekendsIdle": 123
        }
      ],
      "constracts": [
        {
          "name": "<string>",
          "max": "<string>",
          "min": "<string>",
          "maxConsecutiveWorkDays": 123,
          "maxShiftsDay": 123,
          "minRestBetweenShiftsSameDay": 123,
          "minRest": "<string>",
          "maxWorkingDays": 123,
          "maxShiftLength": "<string>",
          "minShiftLength": "<string>",
          "latestShiftStart": "<string>",
          "earliestShiftStart": "<string>",
          "latestShiftEnd": "<string>"
        }
      ]
    }
  ],
  "shifts": [
    {
      "name": "<string>",
      "from": "2023-11-07T05:31:56Z",
      "to": "2023-11-07T05:31:56Z",
      "min": 123,
      "max": 123,
      "tags": [
        {
          "name": "<string>"
        }
      ],
      "skills": [
        {
          "name": "<string>",
          "hard": true,
          "weight": 123
        }
      ],
      "priority": 123,
      "cost": 123,
      "rests": [
        {
          "periodType": "DAILY",
          "tags": [
            "<string>"
          ],
          "excludes": [
            "<string>"
          ],
          "period": {
            "from": "2022-03-10T12:15:50",
            "to": "2022-03-10T12:15:50",
            "duration": "<string>",
            "period": "<string>",
            "excludes": [
              "2023-12-25"
            ],
            "type": "DAILY"
          },
          "min": "<string>",
          "minConsecutive": "<string>",
          "max": "<string>",
          "frequency": 123,
          "sequence": "BEFORE"
        }
      ],
      "blocklist": [
        "<string>"
      ],
      "value": 123,
      "employees": [
        "<string>"
      ],
      "locked": [
        true
      ],
      "location": {
        "lat": 123,
        "lon": 123
      }
    }
  ],
  "rules": [
    {
      "constraint": "COUNTER",
      "type": "HOURS_WORKED",
      "period": {
        "from": "2022-03-10T12:15:50",
        "to": "2022-03-10T12:15:50",
        "duration": "<string>",
        "period": "<string>",
        "excludes": [
          "2023-12-25"
        ],
        "type": "DAILY"
      },
      "min": 123,
      "max": 123,
      "shifts": [
        "<string>"
      ],
      "then": {}
    }
  ],
  "rests": [
    {
      "periodType": "DAILY",
      "tags": [
        "<string>"
      ],
      "excludes": [
        "<string>"
      ],
      "period": {
        "from": "2022-03-10T12:15:50",
        "to": "2022-03-10T12:15:50",
        "duration": "<string>",
        "period": "<string>",
        "excludes": [
          "2023-12-25"
        ],
        "type": "DAILY"
      },
      "min": "<string>",
      "minConsecutive": "<string>",
      "max": "<string>",
      "frequency": 123,
      "sequence": "BEFORE"
    }
  ],
  "demands": [
    {
      "from": "2023-11-07T05:31:56Z",
      "to": "2023-11-07T05:31:56Z",
      "skills": [
        {
          "name": "<string>",
          "hard": true,
          "weight": 123
        }
      ],
      "name": "<string>",
      "min": 123,
      "max": 123
    }
  ],
  "patterns": [
    {
      "type": "SINGLE_DAY",
      "satisfy": "PREFERRED",
      "elements": [
        {
          "type": "ON",
          "tags": [
            "<string>"
          ]
        }
      ],
      "weight": 123
    }
  ],
  "fairnessBuckets": [
    {
      "employees": [
        "<string>"
      ],
      "shifts": [
        "<string>"
      ],
      "target": "<string>",
      "period": {
        "from": "2022-03-10T12:15:50",
        "to": "2022-03-10T12:15:50",
        "duration": "<string>",
        "period": "<string>",
        "excludes": [
          "2023-12-25"
        ],
        "type": "DAILY"
      }
    }
  ],
  "requirements": [
    {
      "shifts": [
        "<string>"
      ],
      "skill": "<string>",
      "value": 123
    }
  ],
  "assignments": [
    {
      "shift": "<string>",
      "employee": "<string>",
      "locked": true
    }
  ],
  "weights": {
    "unassigned": "<string>",
    "maxWorkingDays": "<string>",
    "concurrent": "<string>",
    "sameDay": "<string>",
    "minRest": "<string>",
    "maxConsecutive": "<string>",
    "working": "<string>",
    "sameDayMinRest": "<string>",
    "minHours": "<string>",
    "minHoursUnassigned": "<string>",
    "maxHours": "<string>",
    "minShift": "<string>",
    "maxShift": "<string>",
    "shiftStart": "<string>",
    "latestShiftStart": "<string>",
    "shiftEnd": "<string>",
    "dayOfWeek": "<string>",
    "requirements": "<string>",
    "availability": "<string>",
    "skills": "<string>",
    "criticalSkills": "<string>",
    "locked": "<string>",
    "blacklist": "<string>",
    "pref": "<string>",
    "costs": "<string>",
    "wages": "<string>",
    "efficiency": "<string>",
    "distance": "<string>",
    "distanceAL": "<string>",
    "priority": "<string>",
    "softSkills": "<string>",
    "softSkillsLevel": "<string>",
    "fairness": "<string>"
  },
  "options": {
    "hardAvailability": true,
    "hardSkill": true,
    "hardBlacklist": true,
    "partialPlanning": true,
    "penaliseZeroHours": true,
    "useAvailabilityLocations": true,
    "alwaysScoreSharedSkills": true,
    "explanation": {
      "enabled": true,
      "filterHardConstraints": true
    },
    "idleWeekend": {
      "fromDayOfWeek": "MONDAY",
      "fromTime": "<string>",
      "toDayOfWeek": "MONDAY",
      "toTime": "<string>",
      "restTime": "<string>"
    }
  },
  "hook": "<string>",
  "label": "<string>"
}
'
{
  "id": "<string>",
  "status": "QUEUED",
  "solveDuration": 123,
  "errors": [
    {
      "message": "<string>",
      "code": 123
    }
  ],
  "warnings": [
    {
      "message": "<string>",
      "code": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

Api Key based authentication (apikey)

Body

application/json

FILL request for solving, evaluating

employees
employees · object[]
required

List of employees

Minimum array length: 1
shifts
object[]
required

List of shifts that should be assigned to employees

Minimum array length: 1
rules
object[] | null

List of Rules. Rules can be Counters or Series.

rests
object[] | null

List of Rest definitions. A rest is defined for a fixed period or a duration.

demands
object[] | null

List of shift demands. Demands are periodic minima and maxima for a certain number of employees to be present.

patterns
object[] | null

List of shift patterns. Patterns are sequences of shifts that can be desired or prohibited.

fairnessBuckets
object[] | null

Buckets or groups of employees where fairness in workload is required.

requirements
object[] | null

List of shared skill requirements. Shared skills are skill requirements that govern a group of shifts.

assignments
object[] | null

List of assignments that are pre-set. (optional)

weights
object

Weights adjust objectives and scores.

options
object

Options for tuning the solver

hook
string<uri> | null

Webhook endpoint to receive POST request with the id.

label
string | null

Response

OK

Status of a solve job

id
string
required

Job ID

status
enum<string> | null

Status of the solve.

Available options:
QUEUED,
SOLVING,
SOLVED,
ERROR
solveDuration
integer<int32> | null

Duration of the solve in seconds

errors
object[] | null

List of errors

warnings
object[] | null

List of warnings