List zones
- Sandbox: available
- Staging: available
- Production: unknown
Lists the zones of your project with their device counts. A zone is a FHIR Organization. Use it for a zone overview; use GET /v1/slim/zones/{zoneId} for one zone's locations.
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 and Device:read (an admin or super admin who holds no access policy skips this check).
Scope: The caller's project (from the token).
Behaviour
- Counts are taken from the same rows as
GET /v1/slim/device/live: only devices assigned to a resident are counted.deviceCountis the number of such devices in the zone;activeDeviceCountandinactiveDeviceCountsplit them by whether the device is currently active, as on the live view. - Only zones with at least one counted device are listed. A zone with no assigned devices does not appear;
GET /v1/slim/zones/device-counts?includeEmpty=truelists it. searchkeeps zones whose name contains the text, ignoring case.sortBy:name(default),deviceCount,activeDeviceCountorinactiveDeviceCount.orderBy:ASC(default) orDESC.- Paging:
pagefrom 0,countfrom 1 to 100 (default 20).totalis the number of zones after the search filter.
Example
curl -X GET 'https://api.sandbox.ovok.com/v1/slim/zones?sortBy=deviceCount&orderBy=DESC&page=0&count=20' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'bearerAuthorizationBearer <JWT>page?string"0"count?string"20"sortBy?string"name""name""deviceCount""activeDeviceCount""inactiveDeviceCount"orderBy?string"ASC""ASC""DESC"search?string1 <= lengthZones retrieved successfully.
application/json- response
total*number0 <= valuepage*number0 <= valuecount*number1 <= valueresources*array<>curl -X GET 'https://api.sandbox.ovok.com/v1/slim/zones'{ "total": 0, "page": 0, "count": 1, "resources": [ { "zoneId": "string", "zoneName": "string", "deviceCount": 0, "assignedResidentDeviceCount": 0, "activeDeviceCount": 0, "inactiveDeviceCount": 0 } ]}Delete user DELETE
Removes a practitioner from a project: deletes their membership and practitioner profile, and their user account when this was their last membership. Use it to offboard a team member. **Auth:** Bearer token for a practitioner, project admin or System Owner session. The caller's access policy must grant `Practitioner:delete` (a project admin who holds no access policy skips this check). **Scope:** The practitioner's project must be the caller's project (from the token) or a direct child of it. ## Behaviour - `profileType` must be `Practitioner` and `profileId` a UUID. - The membership, the practitioner and, when it has no other membership, the user are deleted together or not at all. - The owner of the caller's own project cannot be deleted. The owner of a child project can. - After the delete, an account-deletion email is sent to the user's email address, if they have one. A failed email does not fail the request. - Returns `{ "success": true }`. ## Example ```bash curl -X DELETE 'https://api.sandbox.ovok.com/v1/slim/user/Practitioner/c3499c27-2973-0a7f-807e-fb8676a92dcb' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```
Get zone device counts GET
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` (an admin or super admin who holds no access policy skips 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 ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/slim/zones/device-counts?includeEmpty=true&includeUnassigned=true' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```