Route optimization
Reorder a set of points so the total travel time between them is as small as possible.
This operation reorders a set of points so that the total travel time between them is as small as possible, which cuts transit time and cost on a multi-stop round.
It works on raw points rather than on a stored route, so there is no need to create a route and its checkpoints first. Send the points, and the response says what order to visit them in.
API actions
API base path: /task/route/points/optimize.
Required sub-user rights: task_update.
Return the order in which a set of points should be visited to minimise travel time. Creates nothing, so neither a route nor its checkpoints need to exist first.
The suggested order respects each point's time window. Points with earlier windows get lower positions, and where windows overlap the order may vary to make the route as a whole more efficient.
Limits: 2 to 49 points to visit, plus the start point, and 5000 km total distance. Sending one point returns error 7 with "The number of points must be in the range [2..49]".
result is the new order expressed as source indexes: the first entry says which of the points you sent should be visited first. So [2, 0, 1] means visit the third point you sent, then the first, then the second.
Requires the task_update right.
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.
The suggested order
true if request finished successfully.
trueIndexes into route_points, in the order the points should be visited.
Bad request. The response body carries the API-level error code in status.code. Validation failures also include an errors array naming each offending parameter.
Error 210: the overall route distance is more than the 5000 km limit. Error 264: timeout not reached, meaning the call rate is too high.
Error response object
POST /v2/task/route/points/optimize HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 156
{
"start_point": {
"lat": 1,
"lng": 1,
"departure": "text"
},
"route_points": [
{
"location": {
"lat": 1,
"lng": 1
},
"from": "2026-08-24 09:00:00",
"to": "2026-08-24 09:00:00"
}
]
}{
"success": true,
"result": [
1
]
}Errors
These errors come in addition to the general error codes:
7 - Invalid parameters.
210 - Path distance exceeds the max distance limit - if the overal route distance is more than 5000 km.
264 - Timeout not reached - too high api call rate.
How the result is read
The result will return the order in which the points should be visited.
If for route points:
this action returns: [2, 0, 1]
it means "change points order as following":
or with a more tangible example with 5 points. You have the next points to be reordered
Sending those five points with a start point of "lat": 38.81476676765485, "lng": -77.1608018875122, the Navixy platform will reply to you with:
So the optimized route with start point from "lat": 38.81476676765485, "lng": -77.1608018875122 should be:
Last updated
Was this helpful?