Alerts
Alert management for sensors
Fetches alerts for all sensors the user has access to or a single sensor if an optional parameter is provided.
Optional filter to get alerts for a single sensor by its MAC address (e.g. C5:2A:E7:4D:CE:7F).
C5:2A:E7:4D:CE:7FPattern: ^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$Alerts fetched successfully
UNAUTHORIZED - Auth token missing
FORBIDDEN - User does not have access to the requested sensor
GET /alerts HTTP/1.1
Host: network.ruuvi.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"result": "success",
"data": {
"sensors": [
{
"owner": "[email protected]",
"sensor": "C5:2A:E7:4D:CE:7F",
"name": "Ruuvi EEFF",
"picture": "ruuvi_eeff.jpg",
"public": false,
"canShare": true,
"offsetTemperature": 0,
"offsetHumidity": 0,
"offsetPressure": 0,
"customProfile": false,
"lastUpdated": 1715845699,
"subscription": {
"subscriptionName": "Pro",
"maxClaims": 25,
"maxShares": 40,
"maxSharesPerSensor": 10,
"maxHistoryDays": 731,
"maxResolutionMinutes": 1,
"emailAlertAllowed": true,
"pushAlertAllowed": true,
"telegramAlertAllowed": true,
"delayedAlertAllowed": false,
"pdfExportAllowed": false,
"offlineAlertAllowed": true,
"isActive": true,
"endAt": "2025-12-05T06:15:43.000Z",
"lastUpdated": 1701756942
},
"alerts": [
{
"type": "offline",
"min": 0,
"max": 900,
"counter": 0,
"delay": 0,
"enabled": true,
"description": "",
"triggered": true,
"triggeredAt": "2025-10-26T05:37:13.000Z",
"lastUpdated": 1729918633
},
{
"type": "temperature",
"min": -40,
"max": 85,
"counter": 0,
"delay": 0,
"enabled": false,
"description": "",
"triggered": false,
"triggeredAt": "2024-05-16T08:05:57.000Z",
"lastUpdated": 1715845557
}
]
}
]
}
}Sets an alert on a sensor for a given metric. The alert condition is tested against the absolute value received from the sensors in conjunction with the user-set offsets for that particular sensor.
MAC address of the sensor (e.g. C5:2A:E7:4D:CE:7F)
^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$Type of alert condition
Whether the alert is active. If missing, defaults to false. If value was already existing, it will not be changed.
Lower limit for the alert condition. If missing, defaults to 0. If value was already existing, it will not be changed.
Upper limit for the alert condition. If missing, defaults to 0. If value was already existing, it will not be changed.
Movement counter threshold (relevant for movement type alerts). If missing, defaults to 0. If value was already existing, it will not be changed.
User-provided description of the alert. If missing, defaults to empty string. If value was already existing, it will not be changed.
Delay in minutes before triggering the alert. If missing, defaults to 0. If value was already existing, it will not be changed.
Optional epoch timestamp for the alert. If missing, it is assumed to be the current time.
Alert stored or updated successfully
BAD REQUEST - Missing or malformed fields (sensor, type, or enabled missing; sensor not MAC address; type not valid)
UNAUTHORIZED - Auth token missing
FORBIDDEN - User does not have permission to set alerts for this sensor
CONFLICT - Alert with same or newer timestamp already exists
POST /alerts HTTP/1.1
Host: network.ruuvi.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 146
{
"sensor": "C5:2A:E7:4D:CE:7F",
"type": "temperature",
"enabled": true,
"min": 18.5,
"max": 25,
"description": "Temperature alert for greenhouse",
"delay": 15
}{
"result": "success",
"data": {
"action": "success"
}
}Last updated