Skip to main content

Get visible vehicle types

GET 

/vehicles_types/

This endpoint returns a paginated list of vehicle types visible in the system.

Functionality:

  • Filters only vehicle types marked as visible
  • Supports pagination with standard parameters (limit, page)
  • Allows sorting by vehicle license plate
  • Returns basic information such as vehicle type, license plate, image, and ITV

Use Cases:

  1. List vehicles available for assignment to carriers
  2. Display vehicle options in creation forms
  3. Integration with mobile apps to show available fleet

Response Example:

{
docs: [
{
_id: 60a1b2c3d4e5f67890123456,
code: TRUCK,
name: Truck,
description: Heavy vehicle for cargo transport,
visible: true,
createdAt: 2023-05-15T10:30:00Z,
updatedAt: 2023-05-15T10:30:00Z
}
],
total: 1,
limit: 10,
page: 1,
pages: 1
}

Responses

Successful response containing a paginated list of vehicle types.

Response Format:

  • Always return an object with the pagination structure
  • Even for empty results, return the object with docs=[]

Alternative Status Codes:

  • 400: Query parameter error
  • 401: Unauthorized (invalid or expired JWT token)
  • 500: Internal server error

Error Example:

{
error: Invalid token,
message: The authentication token is invalid or expired,
statusCode: 401
}