linxio-js

Services

Domain services exposed by LinxioClient — vehicles, routes, geofences, devices, drivers, sensors, fuel, and metadata.

Each service is accessible as a property of your client instance. All methods return LinxioResult<T> or LinxioPageResult<T> — see SDK Reference for the result contract.

Vehicles

Manage your vehicle fleet: list, read, create, update, archive, and restore vehicles. Use iterate() to collect all records across pages, or stream() for lazy async iteration.

Common vehicle operations
// Paginated list with specific fields
const { data: vehicles, error, meta } = await linxio.vehicles.list({
  fields: ["id", "regNo", "status", "lastLoggedAt"],
  limit: 50,
});

if (error) throw error;
console.log(`${meta.total} total vehicles`);

// Single vehicle by ID
const vehicle = await linxio.vehicles.get(304);

// Aggregate count (no records transferred)
const count = await linxio.vehicles.count({ status: "active" });

// Available vehicle categories
const types = await linxio.vehicles.types();

Routes

Retrieve trip and stop history for a vehicle over a date range. Route coordinates can be large — only request the coordinates field when you need the full point trail.

Fetch vehicle routes
const routes = await linxio.routes.getVehicleRoutes(304, {
  dateFrom: "2026-06-01T00:00:00+08:00",
  dateTo:   "2026-06-08T00:00:00+08:00",
});

if (routes.error) throw routes.error;

// Request coordinates only when needed
const detailed = await linxio.routes.getVehicleRoutes(304, {
  dateFrom: "2026-06-07T00:00:00+08:00",
  dateTo:   "2026-06-08T00:00:00+08:00",
  fields: ["coordinates"],
});

Geofences

Create polygon or circle boundaries, organise them into groups, and manage their lifecycle. Use deliberately named test areas when validating against a live tenant, then archive or delete them afterwards.

Geofence lifecycle
// Create a circular geofence
const depot = await linxio.geofences.create({
  name: "Depot – Perth CBD",
  type: "circle",
  radius: 100,
  coordinates: [{ lat: -31.95, lng: 115.86 }],
});

// Organise into a group
const group = await linxio.geofences.createGroup({ name: "Depots" });

// List all geofences
const all = await linxio.geofences.list({ limit: 100 });

// Archive (soft-delete) when no longer needed
if (!depot.error) {
  await linxio.geofences.archive(depot.data.id);
}

Devices

Track hardware installation state, GPS history, sensor readings, vendor catalogue, and camera assets attached to vehicles.

Device queries
const devices = await linxio.devices.list({
  fields: ["id", "imei", "status", "vehicleId"],
});

// Install a device onto a vehicle
const installed = await linxio.devices.install(deviceId, {
  vehicleId,
  installedAt: new Date().toISOString(),
});

// Vendor catalogue
const vendors = await linxio.devices.vendors();

// Installation history
const history = await linxio.devices.installations({ limit: 100 });

// Camera assets
const cameras = await linxio.devices.cameras(deviceId);

Drivers

Assign and unassign drivers from vehicles. Driver objects are managed outside this SDK; the service handles the vehicle–driver relationship.

Driver assignment
await linxio.drivers.assignToVehicle(vehicleId, driverId);
await linxio.drivers.unassignFromVehicle(vehicleId, driverId);

// Full driver list with pagination
const { data: drivers } = await linxio.drivers.iterate({});

Sensors

Query device sensor readings — temperature, humidity, and related telemetry. Date ranges should be kept tight to avoid large payloads.

Temperature and humidity report
const report = await linxio.sensors.deviceTemperatureHumidityReport({
  startDate: "2026-06-01T00:00:00+08:00",
  endDate:   "2026-06-08T00:00:00+08:00",
  limit: 100,
});

Fuel and extended services

Fuel records, scheduled reports, digital forms, cameras, users, clients, and resellers are available as typed service objects. Some of these endpoints were inferred from dashboard bundles rather than the public API docs — inspect your tenant's behaviour before using mutations in production.

Fuel and reports
// Fuel records for a date range
const fuel = await linxio.fuel.records({
  dateFrom: "2026-06-01T00:00:00+08:00",
  dateTo:   "2026-06-08T00:00:00+08:00",
});

// Fuel summary
const summary = await linxio.fuel.summary({ vehicleId: 304 });

// Scheduled reports
const scheduled = await linxio.reports.scheduled();

Metadata

Read-only reference data and tenant settings used by the dashboard. Covers countries, roles, plans, timezones, themes, language options, map API options, provider settings, and feature flags.

Metadata helpers
const countries  = await linxio.metadata.countries();
const timezones  = await linxio.metadata.timezones();
const plan       = await linxio.metadata.currentPlan();
const mapOptions = await linxio.metadata.mapApiOptions();

These are inexpensive reference calls — safe to cache on startup or at infrequent intervals.

On this page