Restore Operation
curl --request POST \
--url https://api.getswitch.io/operations/routes/{route_id}/operations/{op_id}/restore \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getswitch.io/operations/routes/{route_id}/operations/{op_id}/restore"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.getswitch.io/operations/routes/{route_id}/operations/{op_id}/restore', 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}/operations/{op_id}/restore"
req, _ := http.NewRequest("POST", 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))
}{
"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"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Routing Operations
Restore Operation
Clear the cancellation of an operation. completed_at is not changed.
Failure Modes:
- 401: Token is missing or invalid
- 403: Insufficient permissions, or you cannot manage the route’s company and are not one of its drivers
- 404: No route with this ID, or no such operation on it
Required Auth Scopes:
routing-operations:manage
POST
/
operations
/
routes
/
{route_id}
/
operations
/
{op_id}
/
restore
Restore Operation
curl --request POST \
--url https://api.getswitch.io/operations/routes/{route_id}/operations/{op_id}/restore \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getswitch.io/operations/routes/{route_id}/operations/{op_id}/restore"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.getswitch.io/operations/routes/{route_id}/operations/{op_id}/restore', 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}/operations/{op_id}/restore"
req, _ := http.NewRequest("POST", 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))
}{
"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"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
HTTPBearerHTTPBearer
Path Parameters
Response
Operation restored. Returns the updated operation.
Operation as returned in session detail responses.
