Update Cargo Vehicle
curl --request PUT \
--url https://api.getswitch.io/operations/cargo-vehicles/{vehicle_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"capacities": {
"batteries": 50,
"scooters": 10
}
}
'import requests
url = "https://api.getswitch.io/operations/cargo-vehicles/{vehicle_id}"
payload = { "capacities": {
"batteries": 50,
"scooters": 10
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({capacities: {batteries: 50, scooters: 10}})
};
fetch('https://api.getswitch.io/operations/cargo-vehicles/{vehicle_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getswitch.io/operations/cargo-vehicles/{vehicle_id}"
payload := strings.NewReader("{\n \"capacities\": {\n \"batteries\": 50,\n \"scooters\": 10\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"capacities": {
"batteries": 40,
"scooters": 12
},
"company_slug": "acme-mobility",
"created_at": "2026-10-02T09:15:00Z",
"icon": "Truck",
"id": 3,
"name": "Cargo Van 01",
"updated_at": "2026-11-12T16:40:00Z"
}Fleet Management
Update Cargo Vehicle
Update a cargo vehicle. Only the fields you send change; capacities replaces the whole object.
Failure Modes:
- 401: Token is missing or invalid
- 403: Insufficient permissions, or you cannot manage the cargo vehicle’s company or the new
company_slug - 404: No cargo vehicle with this ID
- 422: Invalid request body
Required Auth Scopes:
cargo-vehicles:manage
PUT
/
operations
/
cargo-vehicles
/
{vehicle_id}
Update Cargo Vehicle
curl --request PUT \
--url https://api.getswitch.io/operations/cargo-vehicles/{vehicle_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"capacities": {
"batteries": 50,
"scooters": 10
}
}
'import requests
url = "https://api.getswitch.io/operations/cargo-vehicles/{vehicle_id}"
payload = { "capacities": {
"batteries": 50,
"scooters": 10
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({capacities: {batteries: 50, scooters: 10}})
};
fetch('https://api.getswitch.io/operations/cargo-vehicles/{vehicle_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getswitch.io/operations/cargo-vehicles/{vehicle_id}"
payload := strings.NewReader("{\n \"capacities\": {\n \"batteries\": 50,\n \"scooters\": 10\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"capacities": {
"batteries": 40,
"scooters": 12
},
"company_slug": "acme-mobility",
"created_at": "2026-10-02T09:15:00Z",
"icon": "Truck",
"id": 3,
"name": "Cargo Van 01",
"updated_at": "2026-11-12T16:40:00Z"
}Authorizations
HTTPBearerHTTPBearer
Body
application/json
Schema for partially updating a cargo vehicle.
Only provided fields are applied; omitted fields remain unchanged.
Response
Cargo vehicle updated successfully. Returns the updated vehicle profile including capacity specs and company ownership.
Public schema for a cargo vehicle resource.
Exposes cargo vehicle details to API consumers, including capacity specs and company ownership.
