Assign Drivers
Assign vehicles to trips
POST
/scheduling/assignAssign drivers/vehicles to trips based on attributes, availability, and configurable scoring weights. This endpoint is asynchronous - it returns a production ID to poll for results.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
trips | Trip[] | Yes | Trips requiring assignment |
cars | Vehicle[] | Yes | Available vehicles |
settings | AssignmentSettings | No | Assignment configuration |
areas | Area[] | No | Geographic zones |
attributes | Attribute[] | No | Service attributes |
profiles | Profile[] | No | Service profiles |
suppliers | Supplier[] | No | Transportation providers |
Trip
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Trip identifier |
date | ISO8601 | Yes | Trip start time |
duration | number | Yes | Total duration (seconds) |
distance | number | Yes | Total distance (meters) |
seats | number | Yes | Seats required |
attr | string[] | No | Required attributes |
stops | Stop[] | Yes | Trip stops with times and locations |
areas | string[] | No | Areas the trip passes through |
profileName | string[] | No | Service profiles |
supplier | string | No | Preferred supplier |
Stop
| Field | Type | Required | Description |
|---|---|---|---|
loc | Coordinates | Yes | Stop location |
date | ISO8601 | Yes | Scheduled arrival time |
name | string | No | Stop name/address |
wait | number | No | Wait time at stop (seconds) |
Coordinates
| Field | Type | Required | Description |
|---|---|---|---|
lat | number | Yes | Latitude |
lng | number | Yes | Longitude |
Vehicle
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Vehicle identifier |
seats | number | Yes | Total seat capacity |
attr | string[] | Yes | Vehicle attributes (wheelchair, gurney, etc.) |
addrLoc | Coordinates | Yes | Home/starting location |
shifts | Shift[] | No | Availability schedule |
capacities | CapacityConfig[] | No | Advanced capacity configurations |
driver | string | No | Assigned driver ID |
areas | string[] | No | Service areas |
costPerMinute | number | No | Operating cost |
Shift
| Field | Type | Required | Description |
|---|---|---|---|
start | ISO8601 | Yes | Shift start time |
end | ISO8601 | Yes | Shift end time |
areas | string[] | No | Areas valid for this shift |
breaks | Break[] | No | Scheduled break periods |
CapacityConfig
Advanced capacity for attribute-specific seating:
Each configuration represents a valid combination. The engine selects the best fit.
Key Settings
| Setting | Type | Default | Description |
|---|---|---|---|
maxDurNext | number | 30 | Max drive time to trip start (minutes) |
maxGapBetweenTrips | number | 60 | Max gap between trips (minutes) |
maxTripsPerDriver | number | 20 | Max trips per driver |
maxShiftHours | number | 12 | Max shift length (hours) |
assignmentType | string | "actual" | Mode: "actual", "virtual", "hybrid" |
areaMatchScore | number | 500 | Area match bonus |
distanceFromTripScore | number | -0.01 | Distance to trip factor |
Example Response
Response Fields
| Field | Type | Description |
|---|---|---|
productionId | string | ID to poll for results |
status | string | Initial status ("processing") |
Polling for Results
Use the Get Assignment Result endpoint to retrieve the completed assignments:
Poll until status is completed or failed. See Get Assignment Result for the full response format including assignments and unassigned trips.