Vehicles API
Manage and retrieve vehicle (unit) information.
List Vehicles
Retrieve a paginated list of vehicles in your fleet.
GET /api/vehicles
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | No | Page number (default: 1) |
| limit | integer | No | Items per page (default: 10) |
| search | string | No | Search by truck number or VIN |
| status | string | No | Filter: 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 Vehicle
GET /api/vehicles/{unit_id}
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| unit_id | string (UUID) | The vehicle's unique identifier |
Response
Returns a single vehicle object with full details including device info and last known state.
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"
}
}
}
]
}
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
}
| Field | Description |
|---|---|
| dr | Driving |
| on | On Duty (Not Driving) |
| off | Off Duty |
| sb | Sleeper Berth |
| ym | Yard Move |
| pc | Personal Conveyance |