Skip to content

Device App Uptime

GET /api/v1/device-apps/:deviceId/:appCode/uptime

Returns an uptime summary for a specific application running on a specific device, over a configurable time window.

Path parameters

ParameterTypeRequiredDescription
deviceIdintegerYesThe device ID
appCodestringYesThe application code (e.g. "aam", "coatro")

Query parameters

ParameterTypeRequiredDefaultDescription
fromISO 8601 datetimeNoStart of today (midnight, server local time)Start of the time window
toISO 8601 datetimeNoCurrent timeEnd of the time window

Response 200

json
{
  "status": true,
  "message": "Success",
  "data": {
    "app": { "code": "viana-core" },
    "device": { "id": 101, "name": "Store Entrance Camera" },
    "network": { "id": 1, "name": "Retail Network A" },
    "site": { "id": 5, "name": "CBD Store" },
    "location": { "id": 12, "name": "Entrance" },
    "window": {
      "from": "2026-03-30T00:00:00.000Z",
      "to": "2026-03-30T06:30:00.000Z",
      "window_seconds": 23400
    },
    "summary": {
      "running_seconds": 21600,
      "stopped_seconds": 1800,
      "uptime_pct": 92.31,
      "interval_count": 3
    },
    "current_status": {
      "status": "running",
      "since": "2026-03-30T05:00:00.000Z",
      "hb_last_seen_at": "2026-03-30T06:29:50.000Z",
      "source": "heartbeat"
    }
  }
}

Field explanations

  • window - the time range evaluated. window_seconds = to - from in seconds.
  • summary.running_seconds - total seconds the app was in a running or stopped (graceful stop) state within the window. Accounts for interval overlap with window boundaries.
  • summary.stopped_seconds - total gap seconds within the window where no interval record exists (that is, the app was not running and not reporting). This is dead time, not graceful stops.
  • summary.uptime_pct - running_seconds / (running_seconds + stopped_seconds) * 100, rounded to 2 decimal places.
  • summary.interval_count - the number of raw interval records found overlapping the window.
  • current_status - reflects the most recent interval record found. since is when that interval started. hb_last_seen_at is the last heartbeat timestamp recorded for that interval. May be null if no data exists for the window.
  • current_status.status values: "running" (app is active), "stopped" (app stopped gracefully).

Errors

400 INVALID_PARAM, 403 FORBIDDEN_NETWORKS, 404 NOT_FOUND (device not found or not in your networks)