Update a vehicle
Replaces all details of a vehicle with the values you send: optional fields you leave out are cleared. The vehicle number must stay unique. Changing the status to anything other than ACTIVE stops new user assignments.
How to use it
- Fetch the vehicle with Get a vehicle.
- Send the full set of fields (vehicleNumber, vehicleType, status, label, odometer, notes); anything left out is cleared or reset.
- The vehicle is updated; setting a status other than ACTIVE means users can no longer be assigned to it.
BearerAuthAuthorizationBearer <JWT>vehicleId*stringVehicle identifier, from List vehicles.
uuidapplication/json- body
vehicleNumber*stringRegistration or fleet number. Required and must not be used by another vehicle.
vehicleLabel?|Optional friendly name. Also used to name the vehicle's van stock location.
vehicleType*stringRequired. VAN, CAR, MOTORBIKE, FOOT (salesperson on foot) or OTHER.
"VAN""CAR""MOTORBIKE""FOOT""OTHER"status*stringACTIVE (default), INACTIVE, ARCHIVED or DELETED. Users can only be assigned to ACTIVE vehicles.
"ACTIVE""INACTIVE""ARCHIVED""DELETED"lastOdometerKm?|Optional odometer reading in kilometres; zero or more.
int32notes?|Optional free-text notes.
OK
*/*- response
status*stringOutcome of the call: SUCCESS when the request was handled, ERROR otherwise.
message*stringShort human-readable message describing the outcome, e.g. which record was fetched or saved.
data?The vehicle.
curl -X PUT 'https://beta.iotoms.com/api/v1/ops/vehicles/497f6eca-6276-4993-bfeb-53cbbbba6f08' \ -H 'Content-Type: application/json' \ -d '{ "vehicleNumber": "string", "vehicleType": "VAN", "status": "ACTIVE"}'{ "status": "string", "message": "string", "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "vehicleNumber": "string", "vehicleLabel": "string", "vehicleType": "VAN", "status": "ACTIVE", "lastOdometerKm": 0, "notes": "string", "assignment": { "property1": { "assignmentId": "dbf5135c-beb7-4185-80db-2e980c77381b", "userId": 0, "username": "string", "assignmentRole": "string", "assignedAt": "2019-08-24T14:15:22Z", "assignedBy": "string", "isActive": true }, "property2": { "assignmentId": "dbf5135c-beb7-4185-80db-2e980c77381b", "userId": 0, "username": "string", "assignmentRole": "string", "assignedAt": "2019-08-24T14:15:22Z", "assignedBy": "string", "isActive": true } } }}