moovexDocs

Assign Drivers

Assign vehicles to trips

POST/scheduling/assign

Assign 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

FieldTypeRequiredDescription
tripsTrip[]YesTrips requiring assignment
carsVehicle[]YesAvailable vehicles
settingsAssignmentSettingsNoAssignment configuration
areasArea[]NoGeographic zones
attributesAttribute[]NoService attributes
profilesProfile[]NoService profiles
suppliersSupplier[]NoTransportation providers

Trip

FieldTypeRequiredDescription
idstringYesTrip identifier
dateISO8601YesTrip start time
durationnumberYesTotal duration (seconds)
distancenumberYesTotal distance (meters)
seatsnumberYesSeats required
attrstring[]NoRequired attributes
stopsStop[]YesTrip stops with times and locations
areasstring[]NoAreas the trip passes through
profileNamestring[]NoService profiles
supplierstringNoPreferred supplier

Stop

FieldTypeRequiredDescription
locCoordinatesYesStop location
dateISO8601YesScheduled arrival time
namestringNoStop name/address
waitnumberNoWait time at stop (seconds)

Coordinates

FieldTypeRequiredDescription
latnumberYesLatitude
lngnumberYesLongitude

Vehicle

FieldTypeRequiredDescription
idstringYesVehicle identifier
seatsnumberYesTotal seat capacity
attrstring[]YesVehicle attributes (wheelchair, gurney, etc.)
addrLocCoordinatesYesHome/starting location
shiftsShift[]NoAvailability schedule
capacitiesCapacityConfig[]NoAdvanced capacity configurations
driverstringNoAssigned driver ID
areasstring[]NoService areas
costPerMinutenumberNoOperating cost

Shift

FieldTypeRequiredDescription
startISO8601YesShift start time
endISO8601YesShift end time
areasstring[]NoAreas valid for this shift
breaksBreak[]NoScheduled break periods

CapacityConfig

Advanced capacity for attribute-specific seating:

{ "seats": 4, "wheelchair": 1, "gurney": 0 }

Each configuration represents a valid combination. The engine selects the best fit.

Key Settings

SettingTypeDefaultDescription
maxDurNextnumber30Max drive time to trip start (minutes)
maxGapBetweenTripsnumber60Max gap between trips (minutes)
maxTripsPerDrivernumber20Max trips per driver
maxShiftHoursnumber12Max shift length (hours)
assignmentTypestring"actual"Mode: "actual", "virtual", "hybrid"
areaMatchScorenumber500Area match bonus
distanceFromTripScorenumber-0.01Distance to trip factor

Example Response

{
  "productionId": "prod_assign_xyz",
  "status": "processing"
}

Response Fields

FieldTypeDescription
productionIdstringID to poll for results
statusstringInitial status ("processing")

Polling for Results

Use the Get Assignment Result endpoint to retrieve the completed assignments:

GET /scheduling/result/{productionId}

Poll until status is completed or failed. See Get Assignment Result for the full response format including assignments and unassigned trips.

On this page