Skip to content
GuidesPlaygroundDashboard

Optimize route through waypoints

$ plaza optimize create
POST/api/v1/optimize

Optimize route through waypoints

ParametersExpand Collapse
--waypoints: object { coordinates, type }

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

--mode: optional "auto" or "foot" or "bicycle"

Travel mode (default: auto)

--roundtrip: optional boolean

Whether route returns to start (default: true)

ReturnsExpand Collapse
optimize_result: OptimizeCompletedResult { geometry, properties, status, type } or OptimizeProcessingResult { job_id, status }

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

optimize_completed_result: object { geometry, properties, status, type }

Completed optimization — GeoJSON Feature with optimized route

geometry: object { 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)

union_member_0: array of number
union_member_1: array of array of number
union_member_2: array of array of array of number
union_member_3: array of array of array of array of number
type: "Point" or "LineString" or "Polygon" or 3 more
"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

"completed"
type: "Feature"
"Feature"
optimize_processing_result: object { job_id, status }

Async optimization in progress — poll with the job_id

job_id: string

Job ID for polling

status: "processing"

Job status

"processing"

Optimize route through waypoints

plaza optimize create \
  --api-key 'My API Key' \
  --waypoints '{coordinates: [0], type: Point}'
Returns Examples