Skip to main content
POST
Solve Multi-Fleet Routing (Two-Phase Greedy)

Authorizations

Authorization
string
header
required

An API key, sent as Authorization: Bearer <key>. Create one in the SWITCH Copilot under Settings → API keys (needs the API keys permission in your company), or with POST /auth/api-keys. The key is shown once, at creation.

Body

application/json

Payload for multi-fleet routing optimization.

fleets
Fleet · object[]
required

List of available vehicles/fleets

operation_pool
Operation · object[]
required

Pool of operations to be distributed among fleets

must_include_vehicles
string[] | null

Optional list of vehicle IDs whose operations should be heavily prioritized across all fleets. Operations targeting a vehicle in this list have their profit multiplied by 1000, making them very likely to be assigned and included in the optimized routes.

Response

Multi-fleet routing plan generated. Returns per-vehicle optimized routes with operation sequencing, timing, and a list of unassigned operations.

Response for multi-fleet routing optimization.

fleet_plans
FleetRoutingPlan · object[]
required

Individual routing plans for each fleet

total_profit
number
required

Sum of profits from all fleet routes

unassigned_operations
Operation · object[]

Operations that couldn't be assigned to any fleet