Update Vehicle by ID
Updates one vehicle in your depot. This is a partial update: only the fields you send change. The same rules as POST /vehicles apply to the fields you do send. For example, switching start_location to other requires start_lat and start_lng in the same request, and setting break: true requires the break times and duration. Sending capacities or skills replaces the vehicle's whole set (an empty array clears it), and leaving them out keeps the existing set.
Changes to availability, shift times and break are applied to the vehicle's default shift. If the vehicle has a per-day or multi-shift schedule set up in the SmartRoutes web app, that schedule is left unchanged. The updated vehicle is returned under vehicle. An id that doesn't belong to a vehicle in your depot returns 400 INVALID_INPUT.
Request
- Base URL: https://api.smartroutes.io/v2
- URL: https://api.smartroutes.io/v2/vehicles/{id}
- Auth: none declared
Path parameters
ID of the vehicle to update.
Request body
Example request
{
"name": "Vehicle Name",
"availability": "shift",
"shift_start": "08:00",
"shift_end": "17:30",
"start_location": "depot",
"end_location": "none",
"break": false,
"capacities": [
{
"id": 1,
"capacity": 500
}
]
}Response
Successful response
Changes
No recorded changes to this operation across all 1 revision of this API.