curl --request GET \
--url https://stage-api.getswitch.io/operations/routes \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/operations/routes"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://stage-api.getswitch.io/operations/routes', 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://stage-api.getswitch.io/operations/routes"
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))
}{
"has_more": true,
"items": [
{
"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,
"progress": 0.5,
"reroute_enabled": true,
"route_identifier": "R1",
"session_slug": "3f6c2a9e-8d41-4b7a-9c2e-5a1f0e7d9b13",
"start_at": "2026-11-30T08:00:00Z",
"status": "active",
"total_distance": 14.2,
"total_operations": 2
},
{
"completed_operations": 6,
"drivers": [
{
"email": "marco.bianchi@acme-mobility.com",
"full_name": "Marco Bianchi",
"id": 57
}
],
"end_at": "2026-11-29T10:10:00Z",
"id": 409,
"progress": 1,
"reroute_enabled": true,
"route_identifier": "R1",
"session_slug": "b07e41d2-5c9a-4f3e-8a61-2d9c7f1e0a44",
"start_at": "2026-11-29T08:00:00Z",
"status": "completed",
"total_distance": 18.6,
"total_operations": 6
}
],
"next_cursor": 408
}List Routes (Cross-Session)
List routes across all sessions, newest first, for a driver app or a dispatch board. scope chooses whose routes: assigned_to_me (routes you are a driver of, in any company, the default), my_company, or company_tree (your company and its child companies). status filters by route status (see status in the response); late routes are also active, and expiration_threshold_minutes sets how long after its last estimated arrival a route stops being active. Routes without operations are never listed.
Pagination: pass the next_cursor of a page as cursor to get the next one; has_more is false on the last page.
Failure Modes:
- 401: Token is missing or invalid
- 403: Insufficient permissions
- 422: Invalid parameters
Required Auth Scopes:
routing-operations:read
curl --request GET \
--url https://stage-api.getswitch.io/operations/routes \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/operations/routes"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://stage-api.getswitch.io/operations/routes', 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://stage-api.getswitch.io/operations/routes"
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))
}{
"has_more": true,
"items": [
{
"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,
"progress": 0.5,
"reroute_enabled": true,
"route_identifier": "R1",
"session_slug": "3f6c2a9e-8d41-4b7a-9c2e-5a1f0e7d9b13",
"start_at": "2026-11-30T08:00:00Z",
"status": "active",
"total_distance": 14.2,
"total_operations": 2
},
{
"completed_operations": 6,
"drivers": [
{
"email": "marco.bianchi@acme-mobility.com",
"full_name": "Marco Bianchi",
"id": 57
}
],
"end_at": "2026-11-29T10:10:00Z",
"id": 409,
"progress": 1,
"reroute_enabled": true,
"route_identifier": "R1",
"session_slug": "b07e41d2-5c9a-4f3e-8a61-2d9c7f1e0a44",
"start_at": "2026-11-29T08:00:00Z",
"status": "completed",
"total_distance": 18.6,
"total_operations": 6
}
],
"next_cursor": 408
}Authorizations
Query Parameters
Response
Routes retrieved. Returns a cursor-paginated list with computed status, progress, driver names, and operation counts.
