# List devices

Canonical page: https://docs.ovok.com/api/slim/device/list-devices

`GET /v1/slim/device`

Lists the devices in your project with their zone, location and resident names. Use it for device directory and administration screens.

**Auth:** bearer token. The caller must be a practitioner, an admin or a System Owner, and needs `Device:search` and `Device:read`.
**Scope:** the caller's project (from the token).

## Behaviour

- Every device in the project is listed, whether or not it has a location or resident.
- `id` is the Device resource id. `thingsboardId` is the device identifier that telemetry is keyed by.
- `status` is `active` when the device's live telemetry reports it active, otherwise `inactive`.
- `lastActivityTime` is the latest telemetry activity time, or the device's last-seen time when telemetry has none.
- `search` matches device, location and zone names. `patientSearch` matches resident names. Both are case-insensitive substring matches.
- `organizationId`, `locationId`, `patientId` and `active` filter on exact values.
- `orderBy` is `ASC` or `DESC` in any case, default `ASC`. Rows with an empty sort value sort last in `ASC` order and first in `DESC` order.
- `page` is zero-based. `count` defaults to 20, maximum 100. `total` is the number of rows after filtering.
- The device structure is cached for up to 5 minutes. Writes made through the Slim routes refresh it sooner.
- If the device list cannot be built and no earlier complete list exists, the route returns 503. Retry shortly.

## Example

```bash
curl -X GET 'https://api.sandbox.ovok.com/v1/slim/device?page=0&count=20&sortBy=deviceName&orderBy=ASC' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'
```
