Skip to main content
POST
Optimize Reroute

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.

Path Parameters

route_id
integer
required

Route ID, from the session detail or the route list.

Body

application/json

Optional body for reroute generation and optimization.

operations_parameters
Operations Parameters · object | null

Accepted for compatibility but not used yet: the plan is always built from the route's stored routing_parameters.

Response

Optimized reroute preview. Returns proposed operations.

Preview of a reroute result — proposed operations to replace pending ones.

route_id
integer
required

Route ID.

kept_operations
integer
required

Number of completed/cancelled operations kept in place.

new_operations
RerouteSuggestion · object[]
required

Proposed operations for the remaining route.

total_distance
number | null

Estimated total distance for the new plan (km).

total_duration
number | null

Estimated total duration for the new plan (minutes).