Route
object represents a planned sequence of stops for a vehicle or delivery agent.
The core of the Route
is the stops
array, which lists the specific locations to visit in order. Each stop within this array details:
- The actions to be performed (like
stopType
). - Associated items (
objectIds
). - Timing estimates (
arrivalTime
,departTime
,serviceTime
). - Travel details from the prior stop (
distanceFromPrevious
,durationFromPrevious
). - The physical coordinates (
location
).
Body
application/json
Input for creating or updating a route.
Route ID. If provided, the route will be updated. If not provided, a new route will be created.
Example:
"rte_JphRWDiEosGpXuxwgaYfY3"
Complete route stops structure with timing, location, and stop types. Supports all stop types including PICKUP, DROPOFF, ROUTE_START, ROUTE_END, and DRIVER_BREAK.
Example:
[
{
"arrival_time": "2025-04-25T08:00:00Z",
"depart_time": "2025-04-25T08:00:00Z",
"location": { "lat": 40.7128, "lng": -74.006 },
"object_ids": ["stl_warehouse_123"],
"service_time": 0,
"stop_type": "ROUTE_START"
},
{
"distance_from_previous": 5000,
"duration_from_previous": 1200,
"location": { "lat": 40.7589, "lng": -73.9851 },
"object_ids": ["ord_123", "ord_456"],
"service_time": 600,
"stop_type": "PICKUP"
},
{
"arrival_time": "2025-04-25T10:00:00Z",
"depart_time": "2025-04-25T10:30:00Z",
"object_ids": ["break_001"],
"service_time": 1800,
"stop_type": "DRIVER_BREAK"
},
{
"distance_from_previous": 2000,
"duration_from_previous": 600,
"location": { "lat": 40.7505, "lng": -73.9934 },
"object_ids": ["ord_123"],
"service_time": 180,
"stop_type": "DROPOFF"
}
]
Additional metadata for the route.
Example:
{
"priority": "high",
"source": "optimization_engine"
}
Response
OK
Response for route upsert operation.
The created or updated route.