Get Session Detail
curl --request GET \
--url https://stage-api.getswitch.io/operations/sessions/{slug} \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/operations/sessions/{slug}"
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/sessions/{slug}', 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/sessions/{slug}"
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))
}{
"company_slug": "acme-mobility",
"created_at": "2026-11-30T07:58:10Z",
"routes": [
{
"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
}
}
]
},
"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"
},
"start_at": "2026-11-30T08:00:00Z",
"total_distance": 14.2
}
],
"slug": "3f6c2a9e-8d41-4b7a-9c2e-5a1f0e7d9b13"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Routing Sessions
Get Session Detail
Get a routing session with all its routes, drivers and operations. Sessions of your child companies are included.
Failure Modes:
- 401: Token is missing or invalid
- 403: Insufficient permissions, or the session belongs to a company you cannot access
- 404: No session with this slug
Required Auth Scopes:
routing-sessions:read
GET
/
operations
/
sessions
/
{slug}
Get Session Detail
curl --request GET \
--url https://stage-api.getswitch.io/operations/sessions/{slug} \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/operations/sessions/{slug}"
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/sessions/{slug}', 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/sessions/{slug}"
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))
}{
"company_slug": "acme-mobility",
"created_at": "2026-11-30T07:58:10Z",
"routes": [
{
"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
}
}
]
},
"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"
},
"start_at": "2026-11-30T08:00:00Z",
"total_distance": 14.2
}
],
"slug": "3f6c2a9e-8d41-4b7a-9c2e-5a1f0e7d9b13"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
HTTPBearerHTTPBearer
Response
Session retrieved. Returns the session with routes, operations, and drivers.
Full session detail response (includes routes + operations).
