List Operations in Route
curl --request GET \
--url https://stage-api.getswitch.io/operations/routes/{route_id}/operations \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/operations/routes/{route_id}/operations"
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/{route_id}/operations', 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/{route_id}/operations"
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))
}[
{
"id": 9031,
"step": 1,
"task_type": "battery_swap",
"latitude": 45.4642,
"longitude": 9.1856,
"provider": "acme-mobility",
"address": "Via Torino 2, 20123 Milano MI",
"vehicle_properties": {
"id": "acme-sc-0193",
"licence_plate": "SC0193",
"lat": 45.4642,
"lon": 9.1856,
"vehicle_type": "scooter",
"vehicle_model": "S-200",
"battery_level": 12,
"last_seen": "2026-11-30T07:50:12Z",
"last_moved": "2026-11-30T06:41:03Z",
"status": "available"
},
"routing_parameters": {
"capacity_delta": {
"charged_battery": -1,
"empty_battery": 1
},
"profit": 2.4
},
"additional_notes": "Battery level (12.0%) below threshold (20.0%)",
"estimated_arrive": "2026-11-30T08:14:00Z",
"completed_at": "2026-11-30T08:17:42Z"
},
{
"id": 9032,
"step": 2,
"task_type": "pickup",
"latitude": 45.4671,
"longitude": 9.1883,
"provider": "acme-mobility",
"address": "Via Mazzini 9, 20123 Milano MI",
"routing_parameters": {
"capacity_delta": {
"vehicles": 1
},
"profit": 2.1
},
"additional_notes": "Zone surplus 1.0 vehicles (threshold: 1.5)",
"estimated_arrive": "2026-11-30T08:23:00Z"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Routing Operations
List Operations in Route
List all operations of a route, ordered by step. 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
Required Auth Scopes:
routing-operations:read
GET
/
operations
/
routes
/
{route_id}
/
operations
List Operations in Route
curl --request GET \
--url https://stage-api.getswitch.io/operations/routes/{route_id}/operations \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/operations/routes/{route_id}/operations"
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/{route_id}/operations', 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/{route_id}/operations"
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))
}[
{
"id": 9031,
"step": 1,
"task_type": "battery_swap",
"latitude": 45.4642,
"longitude": 9.1856,
"provider": "acme-mobility",
"address": "Via Torino 2, 20123 Milano MI",
"vehicle_properties": {
"id": "acme-sc-0193",
"licence_plate": "SC0193",
"lat": 45.4642,
"lon": 9.1856,
"vehicle_type": "scooter",
"vehicle_model": "S-200",
"battery_level": 12,
"last_seen": "2026-11-30T07:50:12Z",
"last_moved": "2026-11-30T06:41:03Z",
"status": "available"
},
"routing_parameters": {
"capacity_delta": {
"charged_battery": -1,
"empty_battery": 1
},
"profit": 2.4
},
"additional_notes": "Battery level (12.0%) below threshold (20.0%)",
"estimated_arrive": "2026-11-30T08:14:00Z",
"completed_at": "2026-11-30T08:17:42Z"
},
{
"id": 9032,
"step": 2,
"task_type": "pickup",
"latitude": 45.4671,
"longitude": 9.1883,
"provider": "acme-mobility",
"address": "Via Mazzini 9, 20123 Milano MI",
"routing_parameters": {
"capacity_delta": {
"vehicles": 1
},
"profit": 2.1
},
"additional_notes": "Zone surplus 1.0 vehicles (threshold: 1.5)",
"estimated_arrive": "2026-11-30T08:23:00Z"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
HTTPBearerHTTPBearer
Response
Operations retrieved. Returns the list ordered by step.
