Get zone device counts
| Method | Path |
|---|---|
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,
deviceCountmatches the rowsGET /v1/slim/device/livereturns for each zone: devices assigned to a resident. all=truecounts every device in each zone, assigned or not, and ignoreseffectiveSleepStatus.effectiveSleepStatus(disconnected,connected,awake,away,asleep) counts only devices in that state. A device that is not active counts asdisconnected.includeUnassigned=truealso counts devices with no resident (unlessall=truealready does) and adds a bucket, withorganizationunset, for devices in no zone.includeEmpty=truekeeps project zones that have no matching devices, with zero counts.- For each zone,
assignedResidentDeviceCountcounts devices with a resident, andactiveDeviceCount/inactiveDeviceCountsplit devices by whether they are currently active. - Zones are sorted by
deviceCount, highest first.totalis the number of entries; thetotal…Countfields 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
| Status | Meaning |
|---|---|
401 | Bearer token is missing, invalid or expired. |
403 | You 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. |
422 | A query parameter fails validation. |