Get all vehicles
GET/v1/vehicles
Retrieves a paginated list of vehicles. Supports filtering by plate number, vehicle type, and supplier.
Request
Query Parameters
Possible values: >= 1
Default value: 1
Page number (default: 1)
Possible values: >= 1
Default value: 10
Items per page (default: 10)
Filter by plate number (case-insensitive)
Filter by vehicle type ID
Filter by supplier ID
Responses
- 200
List of vehicles retrieved successfully
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
data object[]required
The data of the paginated response
The ID of the vehicle
The plate number of the vehicle
The vehicle type ID of the vehicle
The vehicle type name of the vehicle
The supplier ID of the vehicle
The make of the vehicle. Require if the model is provided.
The model of the vehicle
The year of the vehicle
The color of the vehicle
The passengers of the vehicle
The luggage of the vehicle
The created date of the vehicle
The latest update date of the vehicle
The total number of items
The current page
The number of items per page
The total number of pages
{
"data": [
{
"_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"
}
],
"total": 100,
"page": 1,
"limit": 10,
"totalPages": 10
}