Skip to main content

Vehicles API

Manage and retrieve vehicle (unit) information.

List Vehicles

Retrieve a paginated list of vehicles in your fleet.

GET /api/vehicles

Query Parameters

ParameterTypeRequiredDescription
pageintegerNoPage number (default: 1)
limitintegerNoItems per page (default: 10)
searchstringNoSearch by truck number or VIN
statusstringNoFilter: active, inactive, maintenance, out_of_service

Response

{
"count": 30,
"items": [
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"truck_number": "T-1001",
"unit_name": "Unit 1001",
"vin": "1HGCM82633A004352",
"make_name": "Freightliner",
"model": "Cascadia",
"manifacture_year": 2022,
"fuel_type_name": "Diesel",
"license_number": "ABC1234",
"status": "active",
"driver_id": "550e8400-e29b-41d4-a716-446655440000",
"driver_name": "John Doe",
"created_at": "2025-01-10T08:00:00Z"
}
]
}

Example

curl -X GET "https://api-gateway.motioneld.com/api/vehicles?status=active" \
-H "X-API-Key: YOUR_API_KEY"
GET/api/vehicles
page
limit
search
status

Get Vehicle

GET /api/vehicles/{unit_id}

Path Parameters

ParameterTypeDescription
unit_idstring (UUID)The vehicle's unique identifier

Response

Returns a single vehicle object with full details including device info and last known state.

GET/api/vehicles/{unit_id}
unit_id

Fleet Overview

Get an overview of your fleet with driver assignments and status.

GET /api/vehicles/overview

Response

{
"count": 30,
"items": [
{
"id": "...",
"truck_number": "T-1001",
"driver_name": "John Doe",
"status": "active",
"last_state": {
"duty_status": "DR",
"location": {
"lat": 34.0522,
"long": -118.2437,
"address": "I-10, Los Angeles, CA",
"state": "CA"
}
}
}
]
}
GET/api/vehicles/overview

Vehicle Status Counts

Get counts of vehicles by status.

GET /api/vehicles/status-count

Response

{
"dr": 12,
"on": 5,
"off": 8,
"sb": 3,
"ym": 1,
"pc": 1
}
FieldDescription
drDriving
onOn Duty (Not Driving)
offOff Duty
sbSleeper Berth
ymYard Move
pcPersonal Conveyance
GET/api/vehicles/status-count