API Reference
Complete Scheduling Engine API documentation
Overview
The Scheduling Engine API provides driver and vehicle assignment optimization for fleet operations.
Base URLs
| Environment | URL |
|---|---|
| Production | https://scheduling.moovex.ai/api/v1 |
| Staging | https://scheduling.staging.moovex.ai/api/v1 |
Authentication
All requests require a Bearer token:
Endpoints
| Endpoint | Description |
|---|---|
| Assign Drivers | Assign vehicles to trips |
| Get Assignment Result | Retrieve assignment results |
| Check Assignments | Validate existing assignments |
| Calculate Deadhead | Calculate empty vehicle travel |
Data Types
Coordinates
| Field | Type | Description |
|---|---|---|
lat | number | Latitude |
lng | number | Longitude |
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 |
carId | string | No | Pre-assigned vehicle (for validation) |
Stop
| Field | Type | Required | Description |
|---|---|---|---|
loc | Coordinates | Yes | Stop location |
date | ISO8601 | Yes | Scheduled arrival time |
name | string | No | Stop name/address |
Vehicle
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Vehicle identifier |
seats | number | Yes | Total seat capacity |
attr | string[] | Yes | Vehicle attributes |
addrLoc | Coordinates | Yes | Home/starting location |
shifts | Shift[] | No | Availability schedule |
capacities | CapacityConfig[] | No | Advanced capacity configurations |
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. Example - NEMT van:
AssignmentSettings
| 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" |
Error Codes
| Code | Status | Description |
|---|---|---|
invalid_trip | 400 | Invalid trip data |
invalid_vehicle | 400 | Invalid vehicle config |
shift_conflict | 400 | Overlapping shifts |
auth_failed | 401 | Invalid API key |
rate_limited | 429 | Too many requests |