Skip to main content

Get zone device counts

MethodPath
GET/v1/slim/zones/device-counts

Authentication · Access policies

Returns device counts per zone for your project, with project-wide totals. A zone is a FHIR Organization.

Auth: Bearer token. The caller must be a practitioner, an admin, a super admin, or hold the "System Owner" access policy. The access policy must grant Organization:search, Organization:read, Device:search and Device:read (admins and super admins skip this check). Scope: The caller's project (from the token).

Behaviour​

  • By default, deviceCount matches the rows GET /v1/slim/device/live returns for each zone: devices assigned to a resident.
  • all=true counts every device in each zone, assigned or not, and ignores effectiveSleepStatus.
  • effectiveSleepStatus (disconnected, connected, awake, away, asleep) counts only devices in that state. A device that is not active counts as disconnected.
  • includeUnassigned=true also counts devices with no resident (unless all=true already does) and adds a bucket, with organization unset, for devices in no zone.
  • includeEmpty=true keeps project zones that have no matching devices, with zero counts.
  • For each zone, assignedResidentDeviceCount counts devices with a resident, and activeDeviceCount / inactiveDeviceCount split devices by whether they are currently active.
  • Zones are sorted by deviceCount, highest first. total is the number of entries; the total…Count fields sum the per-zone counts.

Example​

curl -X GET 'https://api.sandbox.ovok.com/v1/slim/zones/device-counts?includeEmpty=true&includeUnassigned=true' \
-H "Authorization: Bearer ${OVOK_TOKEN}"

Successful response​

200 — Zone device counts retrieved successfully.

Errors​

StatusMeaning
401Bearer token is missing, invalid or expired.
403You are not a practitioner, admin or System Owner, you lack Organization:search, Organization:read, Device:search or Device:read, or your session has no project.
422A query parameter fails validation.