Update a vehicle
PATCH/v1/vehicles/:id
Updates vehicle information including details, capacity, and status
Request
Path Parameters
id stringrequired
Vehicle ID
- application/json
Body
required
plateNumber string
vehicleTypeId string
supplierId string
make string
The make of the vehicle. Require if the model is provided.
model string
The model of the vehicle.
year number
color string
passengers number
luggage number
Responses
- 200
- 404
Vehicle updated successfully
- application/json
- Schema
- Example (from schema)
Schema
_id stringrequired
The ID of the vehicle
plateNumber stringrequired
The plate number of the vehicle
vehicleTypeId stringrequired
The vehicle type ID of the vehicle
vehicleTypeName stringrequired
The vehicle type name of the vehicle
supplierId stringrequired
The supplier ID of the vehicle
make string
The make of the vehicle. Require if the model is provided.
model string
The model of the vehicle
year number
The year of the vehicle
color string
The color of the vehicle
passengers number
The passengers of the vehicle
luggage number
The luggage of the vehicle
createdDate date-time
The created date of the vehicle
latestUpdate date-time
The latest update date of the vehicle
{
"_id": "672d07188234567890123456",
"plateNumber": "ABC-123",
"vehicleTypeId": "507f1f77bcf86cd799439013",
"vehicleTypeName": "Car",
"supplierId": "507f1f77bcf86cd799439013",
"make": "Toyota",
"model": "Camry",
"year": 2023,
"color": "Black",
"passengers": 1,
"luggage": 1,
"createdDate": "2025-01-01T00:00:00.000Z",
"latestUpdate": "2025-01-01T00:00:00.000Z"
}
Vehicle not found
Loading...