Skip to content
GuidesPlaygroundDashboard

Optimize

Get async optimization result
GET/api/v1/optimize/{job_id}
ModelsExpand Collapse
OptimizeCompletedResult = object { geometry, properties, status, type }

Completed optimization — GeoJSON Feature with optimized route

geometry: GeoJsonGeometry { coordinates, type }
coordinates: array of number or array of array of number or array of array of array of number or array of array of array of array of number

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
array of number
array of array of number
array of array of array of number
array of array of array of array of number
type: "Point" or "LineString" or "Polygon" or 3 more
One of the following:
"Point"
"LineString"
"Polygon"
"MultiPoint"
"MultiLineString"
"MultiPolygon"
properties: object { distance, duration, waypoint_order }
distance: optional number

Total distance in meters

duration: optional number

Estimated duration in seconds

waypoint_order: optional array of number

Optimized waypoint ordering

status: "completed"

Job status

type: "Feature"
OptimizeJobStatus = object { status, error, result }

Status of an async optimization job

status: "completed" or "processing" or "failed"

Job status

One of the following:
"completed"
"processing"
"failed"
error: optional string

Error message when failed

result: optional unknown

Optimization result when completed

OptimizeProcessingResult = object { job_id, status }

Async optimization in progress — poll with the job_id

job_id: string

Job ID for polling

status: "processing"

Job status

OptimizeRequest = object { waypoints, mode, roundtrip }

Route optimization request through waypoints

waypoints: GeoJsonGeometry { coordinates, type }

Waypoints to visit (GeoJSON MultiPoint geometry, minimum 2 points)

coordinates: array of number or array of array of number or array of array of array of number or array of array of array of array of number

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
array of number
array of array of number
array of array of array of number
array of array of array of array of number
type: "Point" or "LineString" or "Polygon" or 3 more
One of the following:
"Point"
"LineString"
"Polygon"
"MultiPoint"
"MultiLineString"
"MultiPolygon"
mode: optional "auto" or "foot" or "bicycle"

Travel mode (default: auto)

One of the following:
"auto"
"foot"
"bicycle"
roundtrip: optional boolean

Whether route returns to start (default: true)

OptimizeResult = OptimizeCompletedResult { geometry, properties, status, type } or OptimizeProcessingResult { job_id, status }

Optimization response — either a completed GeoJSON Feature route or an async job reference

One of the following:
OptimizeCompletedResult = object { geometry, properties, status, type }

Completed optimization — GeoJSON Feature with optimized route

geometry: GeoJsonGeometry { coordinates, type }
coordinates: array of number or array of array of number or array of array of array of number or array of array of array of array of number

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
array of number
array of array of number
array of array of array of number
array of array of array of array of number
type: "Point" or "LineString" or "Polygon" or 3 more
One of the following:
"Point"
"LineString"
"Polygon"
"MultiPoint"
"MultiLineString"
"MultiPolygon"
properties: object { distance, duration, waypoint_order }
distance: optional number

Total distance in meters

duration: optional number

Estimated duration in seconds

waypoint_order: optional array of number

Optimized waypoint ordering

status: "completed"

Job status

type: "Feature"
OptimizeProcessingResult = object { job_id, status }

Async optimization in progress — poll with the job_id

job_id: string

Job ID for polling

status: "processing"

Job status