Vehicles
Add Vehicle
Adds a vehicle to your depot's fleet so it can be used when building plans. The new vehicle is returned under vehicle, in the same shape as GET /vehicles/{id}.
- name (up to 30 characters), availability and start_location are required. start_location and end_location accept depot or other. With other, you must send the matching *_lat and *_lng. Addresses are stored as given and are not geocoded.
- With availability: shift, shift_start must be before shift_end (24-hour HH:mm). With break: true, break_start, break_end and break_duration are all required, and break_duration (in minutes) must be shorter than the break window.
- capacities are matched by id against your depot's capacity types (see GET /capacities). Unknown IDs are dropped without an error. Any skills name not yet in your organisation is created. Names match exactly and are case-sensitive.
- active defaults to true.
Each organisation has a vehicle limit across all its depots. Adding a vehicle beyond that limit returns 400 INVALID_INPUT. This endpoint supports Idempotency.
post/vehicles
Request
- Base URL: https://api.smartroutes.io/v2
- URL: https://api.smartroutes.io/v2/vehicles
- Auth: none declared
Headers
idempotency-keystring
Optional idempotency key for safe retries. See Idempotency for behaviour. 1–255 characters; UUID recommended.
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.