curl --request POST \
--url http://localhost:8000/v1/routes \
--header 'Content-Type: application/json' \
--data '
{
"origin": {
"location": {
"latLng": {
"latitude": 41.878,
"longitude": -87.636
}
}
},
"destination": {
"location": {
"latLng": {
"latitude": 41.705,
"longitude": -87.613
}
}
}
}
'{
"id": "route_01HYX3MPK5XJQJG0NB0PRSDVWC",
"object": "route",
"status": "complete",
"createdAt": "2026-02-28T15:12:32Z",
"routes": [],
"fallbackInfo": null,
"geocodingResults": null,
"warnings": [],
"error": null
}Create Route
Creates a route resource with physics enrichment.
curl --request POST \
--url http://localhost:8000/v1/routes \
--header 'Content-Type: application/json' \
--data '
{
"origin": {
"location": {
"latLng": {
"latitude": 41.878,
"longitude": -87.636
}
}
},
"destination": {
"location": {
"latLng": {
"latitude": 41.705,
"longitude": -87.613
}
}
}
}
'{
"id": "route_01HYX3MPK5XJQJG0NB0PRSDVWC",
"object": "route",
"status": "complete",
"createdAt": "2026-02-28T15:12:32Z",
"routes": [],
"fallbackInfo": null,
"geocodingResults": null,
"warnings": [],
"error": null
}- Fast path (< 3s): Returns
200with the completed route inline. - Slow path (> 3s): Returns
202withstatus: "processing". PollGET /v1/routes/{id}or use awebhookUrlto be notified when it completes.
Idempotency-Key header makes retries safe - if your client times out, just resend with the same key to get the cached response instead of creating a duplicate.Headers
A unique key to ensure idempotent route creation. If a request with the same key was already processed, the cached response is returned. If the same key is reused with a different request body, a 422 error is returned.
"req_abc123"
Body
Request body for route computation. Accepts all Google Routes API fields — unsupported fields are silently ignored.
Origin waypoint (required)
Show child attributes
Show child attributes
Destination waypoint (required)
Show child attributes
Show child attributes
Intermediate waypoints (stops or pass-through points)
Show child attributes
Show child attributes
Travel mode. Only DRIVE is supported (truck routing).
Routing preference. Traffic is not currently modeled.
Departure time in ISO 8601 UTC format. Affects school zone detection and time-based routing.
When true and no intermediate waypoints, returns up to 3 alternative routes.
Route modifiers (avoid tolls, highways, ferries)
Show child attributes
Show child attributes
Language for navigation instructions
Vehicle specification for physics enrichment. Defaults to SEMI_TRAILER preset if omitted.
Show child attributes
Show child attributes
Routing profile that adjusts enrichment weights
balanced, fuel_optimal, time_optimal, fatigue_aware Override individual profile weights (e.g. {"fuelWeight": 1.5})
Show child attributes
Show child attributes
Webhook URL for async route completion notifications. Only used by POST /v1/routes.
Response
Route computed synchronously (fast path). Status is complete with full route data.
A route resource. Used by the /v1/routes endpoint family.
Unique route ID (prefixed with route_)
"route_01HYX3MPK5XJQJG0NB0PRSDVWC"
Object type (always route)
route Current status of the route computation.
processing- route is still being computed (routes array is empty)complete- route computation finished (routes array is populated)failed- route computation failed (error object is populated)
processing, complete, failed ISO 8601 UTC timestamp of creation
"2026-02-28T15:12:32Z"
Computed routes (empty while processing)
Show child attributes
Show child attributes
Error details (populated when status is failed)
Show child attributes
Show child attributes