Get Route Detail
curl --request GET \
--url https://api.getswitch.io/operations/routes/{route_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getswitch.io/operations/routes/{route_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.getswitch.io/operations/routes/{route_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.getswitch.io/operations/routes/{route_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"completed_operations": 1,
"drivers": [
{
"email": "marco.bianchi@acme-mobility.com",
"full_name": "Marco Bianchi",
"id": 57
}
],
"end_at": "2026-11-30T09:40:00Z",
"id": 412,
"operations": [
{
"additional_notes": "Battery level (12.0%) below threshold (20.0%)",
"address": "Via Torino 2, 20123 Milano MI",
"completed_at": "2026-11-30T08:17:42Z",
"estimated_arrive": "2026-11-30T08:14:00Z",
"id": 9031,
"latitude": 45.4642,
"longitude": 9.1856,
"provider": "acme-mobility",
"routing_parameters": {
"capacity_delta": {
"charged_battery": -1,
"empty_battery": 1
},
"profit": 2.4
},
"step": 1,
"task_type": "battery_swap",
"vehicle_properties": {
"battery_level": 12,
"id": "acme-sc-0193",
"last_moved": "2026-11-30T06:41:03Z",
"last_seen": "2026-11-30T07:50:12Z",
"lat": 45.4642,
"licence_plate": "SC0193",
"lon": 9.1856,
"status": "available",
"vehicle_model": "S-200",
"vehicle_type": "scooter"
}
},
{
"additional_notes": "Zone surplus 1.0 vehicles (threshold: 1.5)",
"address": "Via Mazzini 9, 20123 Milano MI",
"estimated_arrive": "2026-11-30T08:23:00Z",
"id": 9032,
"latitude": 45.4671,
"longitude": 9.1883,
"provider": "acme-mobility",
"routing_parameters": {
"capacity_delta": {
"vehicles": 1
},
"profit": 2.1
},
"step": 2,
"task_type": "pickup"
}
],
"operations_parameters": {
"strategies": [
{
"slug": "battery-threshold",
"strat_params": {
"threshold": 20
}
}
]
},
"progress": 0.5,
"reroute_enabled": true,
"route_identifier": "R1",
"routing_parameters": {
"end_coords": {
"latitude": 45.4887,
"longitude": 9.2415
},
"max_capacities": {
"charged_battery": 40,
"empty_battery": 40,
"vehicles": 12
},
"max_duration": 120,
"start_capacities": {
"charged_battery": 40,
"empty_battery": 0,
"vehicles": 0
},
"start_coords": {
"latitude": 45.4887,
"longitude": 9.2415
},
"start_time": "2026-11-30T08:00:00Z"
},
"session_slug": "3f6c2a9e-8d41-4b7a-9c2e-5a1f0e7d9b13",
"start_at": "2026-11-30T08:00:00Z",
"status": "active",
"total_distance": 14.2,
"total_operations": 2
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Routing Sessions
Get Route Detail
Get a route with its operations, drivers, status and progress. Drivers assigned to the route can read it whatever their company.
Failure Modes:
- 401: Token is missing or invalid
- 403: Insufficient permissions, or the route belongs to a company you cannot access
- 404: No route with this ID, or its session was deleted
Required Auth Scopes:
routing-operations:read
GET
/
operations
/
routes
/
{route_id}
Get Route Detail
curl --request GET \
--url https://api.getswitch.io/operations/routes/{route_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getswitch.io/operations/routes/{route_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.getswitch.io/operations/routes/{route_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.getswitch.io/operations/routes/{route_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"completed_operations": 1,
"drivers": [
{
"email": "marco.bianchi@acme-mobility.com",
"full_name": "Marco Bianchi",
"id": 57
}
],
"end_at": "2026-11-30T09:40:00Z",
"id": 412,
"operations": [
{
"additional_notes": "Battery level (12.0%) below threshold (20.0%)",
"address": "Via Torino 2, 20123 Milano MI",
"completed_at": "2026-11-30T08:17:42Z",
"estimated_arrive": "2026-11-30T08:14:00Z",
"id": 9031,
"latitude": 45.4642,
"longitude": 9.1856,
"provider": "acme-mobility",
"routing_parameters": {
"capacity_delta": {
"charged_battery": -1,
"empty_battery": 1
},
"profit": 2.4
},
"step": 1,
"task_type": "battery_swap",
"vehicle_properties": {
"battery_level": 12,
"id": "acme-sc-0193",
"last_moved": "2026-11-30T06:41:03Z",
"last_seen": "2026-11-30T07:50:12Z",
"lat": 45.4642,
"licence_plate": "SC0193",
"lon": 9.1856,
"status": "available",
"vehicle_model": "S-200",
"vehicle_type": "scooter"
}
},
{
"additional_notes": "Zone surplus 1.0 vehicles (threshold: 1.5)",
"address": "Via Mazzini 9, 20123 Milano MI",
"estimated_arrive": "2026-11-30T08:23:00Z",
"id": 9032,
"latitude": 45.4671,
"longitude": 9.1883,
"provider": "acme-mobility",
"routing_parameters": {
"capacity_delta": {
"vehicles": 1
},
"profit": 2.1
},
"step": 2,
"task_type": "pickup"
}
],
"operations_parameters": {
"strategies": [
{
"slug": "battery-threshold",
"strat_params": {
"threshold": 20
}
}
]
},
"progress": 0.5,
"reroute_enabled": true,
"route_identifier": "R1",
"routing_parameters": {
"end_coords": {
"latitude": 45.4887,
"longitude": 9.2415
},
"max_capacities": {
"charged_battery": 40,
"empty_battery": 40,
"vehicles": 12
},
"max_duration": 120,
"start_capacities": {
"charged_battery": 40,
"empty_battery": 0,
"vehicles": 0
},
"start_coords": {
"latitude": 45.4887,
"longitude": 9.2415
},
"start_time": "2026-11-30T08:00:00Z"
},
"session_slug": "3f6c2a9e-8d41-4b7a-9c2e-5a1f0e7d9b13",
"start_at": "2026-11-30T08:00:00Z",
"status": "active",
"total_distance": 14.2,
"total_operations": 2
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
HTTPBearerHTTPBearer
Response
Route retrieved. Returns the route with operations, drivers, computed status, and progress.
Full route detail response (includes operations + drivers).
completed when no operation is left open. Otherwise expired when the route's last estimated arrival is older than the expiration window (24 hours by default), late when an open operation is past its estimated arrival, and active otherwise.
Available options:
active, late, expired, completed 