en
Team & Fleet›Change a vehicle's details

Change a vehicle's details

Edits an existing fleet record in place; the vehicle id and the technicians who use it are untouched. Partial update: omit a field to KEEP its current value, send "" to CLEAR an optional text field (brand, model, plate_number). Exceptions: `name` rejects "" because a vehicle must stay identifiable, and `vehicle_type` (van, truck, car) and `status` (inactive, idle, on_job, maintenance) must be valid enum values when present; an empty string there is a 400. `owner_id`: omit to keep the current owner, "" to unclaim, or a UUID to reassign; the new owner must be a lead or management profile (VEHICLE_OWNER_TIER_NOT_ALLOWED otherwise). Use this for corrections and odometer updates, and set `status` to maintenance or inactive when a vehicle is temporarily out of service so it stays in the fleet. To change which technicians may use it, call replaceTechnicianVehicles; to take it out of the fleet for good, call deleteVehicle.

Arguments

idstringpathrequired
Vehicle ID
brandstringbodyoptional
nil = keep; "" clears the field.
current_mileageintegerbodyoptional
modelstringbodyoptional
namestringbodyoptional
nil = keep. min=1 rejects an explicit "" (a vehicle needs a name); omitempty is what lets a nil pointer skip validation entirely.
owner_idstringbodyoptional
nil = keep the current owner; "" clears it; a UUID sets it.
plate_numberstringbodyoptional
statusenumbodyoptional
vehicle_typeenumbodyoptional
nil = keep; a non-nil value must be a known enum member.
yearintegerbodyoptional
PUT/v1/vehicles/{id}
curl -X PUT "https://api.crisphive.com/v1/vehicles/9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01" \
  -H "Authorization: Bearer chsk_test_4eC8xQ9mZ2pL7Ka0rT" \
  -H "Content-Type: application/json" \
  -d '{
  "brand": "Toyota",
  "current_mileage": 75000,
  "model": "Hiace",
  "name": "Updated Van Name",
  "owner_id": "550e8400-e29b-41d4-a716-446655440000",
  "plate_number": "XYZ-9999",
  "status": "idle",
  "vehicle_type": "van",
  "year": 2024
}'
Request body
{
"brand": ,
"current_mileage": ,
"model": ,
"name": ,
"owner_id": ,
"plate_number": ,
"status": ,
"vehicle_type": ,
"year":
}

Responses