FleetbaseFleetbase

Sensors

Sensors represent measurable telemetry channels such as temperature, door state, vibration, fuel level, or tire pressure.

The Sensor object

A sensor stores measurement type, thresholds, latest reading, associated device, and attachment metadata.
Attributes
idstringoptional

Public sensor identifier.

namestringoptional

Sensor name.

typestringoptional

Sensor type.

devicestringoptional

Device public ID, when loaded.

unitstringoptional

Measurement unit.

last_valuestringoptional

Latest recorded value.

threshold_statusstringoptional

Derived threshold status.

statusstringoptional

Sensor status.

metaobjectoptional

Additional sensor metadata.

The Sensor object
{
  "id": "sensor_2Qx9KpL7Vz",
  "name": "Cargo Temperature",
  "type": "temperature",
  "unit": "celsius",
  "last_value": "4.2",
  "status": "active",
  "threshold_status": "normal",
  "updated_at": "2026-05-07T08:30:00.000000Z",
  "created_at": "2026-05-07T08:30:00.000000Z"
}
POST/v1/sensors

Create a Sensor

Create a sensor.

Body parameters
namestringoptional

Sensor name.

typestringoptional

Sensor type.

devicestringoptional

Device public ID.

telematicstringoptional

Telematic public ID.

unitstringoptional

Measurement unit.

min_thresholdnumberoptional

Minimum threshold.

max_thresholdnumberoptional

Maximum threshold.

sensorable_typestringoptional

Attachable resource type.

sensorablestringoptional

Attachable resource public ID.

POST/v1/sensors
curl -X POST https://api.fleetbase.io/v1/sensors \
  -H "Authorization: Bearer flb_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Cargo Temperature",
  "type": "temperature",
  "device": "{{device_id}}",
  "unit": "celsius",
  "status": "active",
  "min_threshold": 0,
  "max_threshold": 8
}'
201 OK
{
  "id": "<string>",
  "object": "sensors"
}
GET/v1/sensors

Query Sensors

Query sensors.

Query parameters
querystringoptional

Search query for sensors.

limitintegeroptional

Maximum number of records to return.

pageintegeroptional

Page number for paginated results.

sortstringoptional

Sort expression, such as -created_at.

typestringoptional

Filter by sensor type.

statusstringoptional

Filter by sensor status.

devicestringoptional

Filter by device public ID or internal ID.

GET/v1/sensors
curl https://api.fleetbase.io/v1/sensors \
  -H "Authorization: Bearer flb_live_…"
200 OK
{
  "id": "<string>",
  "object": "sensors"
}
GET/v1/sensors

Retrieve a Sensor

Retrieve a sensor.

GET/v1/sensors
curl https://api.fleetbase.io/v1/sensors \
  -H "Authorization: Bearer flb_live_…"
200 OK
{
  "id": "<string>",
  "object": "sensors"
}
PUT/v1/sensors

Update a Sensor

Update a sensor.

Body parameters
namestringoptional

Sensor name.

typestringoptional

Sensor type.

devicestringoptional

Device public ID.

telematicstringoptional

Telematic public ID.

unitstringoptional

Measurement unit.

min_thresholdnumberoptional

Minimum threshold.

max_thresholdnumberoptional

Maximum threshold.

sensorable_typestringoptional

Attachable resource type.

sensorablestringoptional

Attachable resource public ID.

PUT/v1/sensors
curl -X PUT https://api.fleetbase.io/v1/sensors \
  -H "Authorization: Bearer flb_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "last_value": "4.2",
  "last_reading_at": "2026-05-07T08:30:00Z"
}'
200 OK
{
  "id": "<string>",
  "object": "sensors"
}
DELETE/v1/sensors

Delete a Sensor

Delete a sensor.

DELETE/v1/sensors
curl -X DELETE https://api.fleetbase.io/v1/sensors \
  -H "Authorization: Bearer flb_live_…"
200 OK
{
  "id": "<string>",
  "deleted": true
}
Sensors | Fleetbase