linxio-js
SDK Reference

Vehicles

Vehicle inventory, pagination, lifecycle, odometer, engine-hours, counts, and type helpers.

The vehicle service is the main entry point for fleet inventory. Use field projection aggressively on list and iterate calls to keep large fleets fast.

vehicles.list()

GET

List vehicles

/vehicles/fields/jsonlinxio.vehicles.list(params)

Loads one page of vehicles.

Input

params.limit
number
optional
Number of vehicles to request.
params.page
number
optional
Page number to request.
Default: 1
params.fields
VehicleField[]
optional
Vehicle fields to include, such as id, regNo, status, lastLoggedAt, lastCoordinates, or todayData.
params.sort
string
optional
Sort expression accepted by Linxio.
params.[filter]
QueryValue
optional
Additional filters are forwarded as query parameters.

Returns

data
LinxioVehicle[] | null
optional
Vehicles for the requested page.
meta
{ page: number; limit: number; total: number } | null
optional
Pagination metadata.
error
LinxioError | null
optional
Typed SDK error when the page fails to load.

vehicles.iterate()

GET

Load all vehicles

/vehicles/fields/jsonlinxio.vehicles.iterate(params)

Auto-paginates all vehicle pages and returns a single result object.

Input

params
LinxioVehicleListParams
optional
Same parameters as vehicles.list(). limit controls the page size used while collecting all pages.

Returns

data
LinxioVehicle[] | null
optional
Flat array containing all loaded vehicles.
error
LinxioError | null
optional
Typed SDK error if any page fails.

vehicles.stream()

GET

Stream vehicles

/vehicles/fields/jsonlinxio.vehicles.stream(params)

Streams vehicles lazily across pages. Use this for large tenants or scheduled jobs where memory use matters.

Input

params
LinxioVehicleListParams
optional
Same parameters as vehicles.list().

Returns

yield
LinxioVehicle
optional
One vehicle at a time.
throws
LinxioError
optional
The generator throws if any page fails.

vehicles.get()

GET

Get a vehicle

/vehicles/{vehicleId}linxio.vehicles.get(vehicleId)

Fetches one vehicle by internal Linxio vehicle ID.

Input

vehicleId
LinxioId
required
Vehicle identifier.

Returns

data
LinxioVehicle | null
optional
The vehicle record.
error
LinxioError | null
optional
Typed SDK error when the vehicle cannot be loaded.

vehicles.create()

POST

Create a vehicle

/vehicleslinxio.vehicles.create(payload)

Creates a vehicle. Tenant validation rules can vary, so send only fields you know are valid for your Linxio account.

Input

payload.regNo
string
optional
Registration number or fleet identifier.
payload.defaultLabel
string
optional
Default display label.
payload.model
string
optional
Vehicle model text.
payload.typeId
LinxioId
optional
Vehicle type ID from vehicles.types().
payload.depotId
LinxioId | null
optional
Depot identifier when the tenant uses depots.
payload.groupIds
LinxioId[]
optional
Vehicle group IDs.
payload.vin
string
optional
Vehicle identification number.

Returns

data
LinxioVehicle | null
optional
Created vehicle.
error
LinxioError | null
optional
Typed SDK error when creation fails.

vehicles.update()

POST

Update a vehicle

/vehicles/{vehicleId}linxio.vehicles.update(vehicleId, payload)

Updates vehicle fields using Linxio's POST update endpoint.

Input

vehicleId
LinxioId
required
Vehicle identifier.
payload
LinxioVehiclePayload
required
Partial vehicle payload containing fields to change.

Returns

data
LinxioVehicle | null
optional
Updated vehicle.
error
LinxioError | null
optional
Typed SDK error when update fails.

vehicles.archive()

PATCH

Archive a vehicle

/vehicles/{vehicleId}/archivelinxio.vehicles.archive(vehicleId)

Soft-archives a vehicle. Prefer this over destructive actions when you need reversibility.

Input

vehicleId
LinxioId
required
Vehicle identifier.

Returns

data
void
optional
Undefined on success.
error
LinxioError | null
optional
Typed SDK error when archive fails.

vehicles.restore()

POST

Restore a vehicle

/vehicles/{vehicleId}/restorelinxio.vehicles.restore(vehicleId)

Restores a previously archived vehicle.

Input

vehicleId
LinxioId
required
Archived vehicle identifier.

Returns

data
void
optional
Undefined on success.
error
LinxioError | null
optional
Typed SDK error when restore fails.

vehicles.getOdometer()

GET

Get vehicle odometer

/vehicles/{vehicleId}/odometerlinxio.vehicles.getOdometer(vehicleId, params)

Reads the current odometer value, or the value at a supplied occurrence time when Linxio supports it for the tenant.

Input

vehicleId
LinxioId
required
Vehicle identifier.
params.occurredAt
ISODateString
optional
Optional occurrence timestamp.

Returns

data.odometer
number
optional
Odometer reading.
data.vehicleId
LinxioId
optional
Vehicle the reading belongs to.
error
LinxioError | null
optional
Typed SDK error when the reading cannot be loaded.

vehicles.recalibrateOdometer()

POST

Recalibrate vehicle odometer

/vehicles/{vehicleId}/odometerlinxio.vehicles.recalibrateOdometer(vehicleId, payload)

Recalibrates a vehicle odometer. Treat this as an operational change and only call it with confirmed values.

Input

vehicleId
LinxioId
required
Vehicle identifier.
payload.occurredAt
ISODateString
required
When the recalibrated reading applies.
payload.odometer
number
required
New odometer value.

Returns

data
LinxioOdometer | null
optional
Updated odometer reading.
error
LinxioError | null
optional
Typed SDK error when recalibration fails.

vehicles.getEngineHours()

GET

Get vehicle engine hours

/vehicles/{vehicleId}/engine-hours/currentlinxio.vehicles.getEngineHours(vehicleId)

Reads the current engine-hours value for a vehicle.

Input

vehicleId
LinxioId
required
Vehicle identifier.

Returns

data.engineHours
number
optional
Current engine-hours reading.
data.occurredAt
ISODateString | null
optional
Timestamp associated with the reading when supplied.
error
LinxioError | null
optional
Typed SDK error when the reading cannot be loaded.

vehicles.count()

GET

Count vehicles

/vehicles/countlinxio.vehicles.count(params)

Returns a count without fetching vehicle records.

Input

params
LinxioVehicleCountParams
optional
Optional dashboard-derived filters forwarded as query parameters.

Returns

data.count
number
optional
Vehicle count when Linxio returns count.
data.total
number
optional
Vehicle count when Linxio returns total.
error
LinxioError | null
optional
Typed SDK error when count fails.

vehicles.types()

GET

List vehicle types

/vehicles/typeslinxio.vehicles.types(params)

Lists vehicle type categories visible to the authenticated account.

Input

params.limit
number
optional
Maximum number of type records.
Default: 1000
params.sort
string
optional
Sort expression.
Default: order
params.[filter]
QueryValue
optional
Additional filters forwarded as query parameters.

Returns

data
LinxioVehicleType[] | null
optional
Vehicle type records, usually including id, name, and order.
error
LinxioError | null
optional
Typed SDK error when type loading fails.

On this page