Skip to main content
POST
Solve Routing Optimization

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

Single-vehicle routing request: the operations and the vehicle's limits.

operation_pool
Operation · object[]
required

List of operations to be considered in the routing solution

start_point
Point · object
required

Starting point for the routing solution

end_point
Point · object
required

Ending point for the routing solution

max_duration
number
default:60

Maximum duration in minutes for the routing solution, default is 60 minutes (1 hour)

max_capacities
Max Capacities · object

Maximum capacities for the routing solution

start_capacities
Start Capacities · object

Starting capacities for the routing solution

start_time
string<date-time>

Starting time for the routing solution, default is the current time

must_include_vehicles
string[] | null

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

refill_capacities
Refill Capacities · object | null

Total depot stock available for refilling across all stops. Positive values represent the total number of items at the depot; each refill loads the vehicle up to max_capacities, drawing from this stock until it is exhausted. Negative values mark capacities that are unloaded (dumped to 0) at the depot with no limit. Keys not present are left untouched.

Example:
depot_service_time
number
default:5

Time in minutes the vehicle spends at depot per refill stop. Only used when refill_capacities is set.

max_depot_refills
integer | null

Maximum number of depot refill stops allowed. None means unlimited (bounded by max_duration). 0 disables the feature.

Response

Routing plan generated successfully with optimized sequence of operations and timing.

Represents the response structure for a redistribution request.

This schema includes a list of steps in the redistribution plan.

plan
RoutingStep · object[]
required

list of redistribution steps

total_profit
number
required

Total profit achieved by the route

total_duration
number
required

Total duration of the route in minutes, including travel to/from depot

total_distance
number
required

Total distance of the route in kilometers, including travel to/from depot

unassigned_operations
Operation · object[]

Operations that couldn't be assigned to the route

utilization
Utilization · object

Maximum capacity usage for each capacity type during the route

Example: