# Get device

Canonical page: https://docs.ovok.com/slim-apis/device/get-device

| Method | Path |
| --- | --- |
| `GET` | `/v1/slim/device/:id` |

[Authentication](/authentication) · [Access policies](/access-policies)

Returns one device with its zone, location and resident assignments and its current connection status. Use it to show or edit a single device.

**Auth:** bearer token. The caller must be a practitioner, an admin or a System Owner, and needs `Device:read`.
**Scope:** the device is read with your token, so Ovok AccessPolicy limits which devices you can read.

## Request [#request]

### Path parameters [#path-parameters]

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string (uuid)` | Yes | Device id. |

## Behaviour [#behaviour]

- `organizationId` is the zone of the device's location. When the device has no location, it falls back to the device's own owner organization.
- `organizationName`, `locationName` and `patientName` are display names. Each is `null` when the resource has no name that can be shown.
- `status` is `active` only when the device was last seen recently enough. A device whose last-seen time is stale reads `inactive`, even if it was never marked offline. A device without an identifier reports its stored FHIR status.
- `statusReason` explains an `inactive` status when the platform recorded why.
- `floor`, `room` and `bed` come from the address of the device's location.
- Read-only. Nothing is written.

## Example [#example]

```bash
curl -X GET 'https://api.sandbox.ovok.com/v1/slim/device/8c5e7a21-4b9d-4f36-a1c8-0d2e6b9f3a54' \
  -H "Authorization: Bearer ${OVOK_TOKEN}"
```

## Successful response [#successful-response]

`200` — The device.

```json
{
  "id": "8c5e7a21-4b9d-4f36-a1c8-0d2e6b9f3a54",
  "name": "Demo/1000001",
  "status": "active",
  "statusReason": [],
  "thingsboardId": "Demo/1000001",
  "organizationId": "1e6b8d30-2c4f-4a95-8d7e-b0a2c4e6f918",
  "organizationName": "Zone A",
  "locationId": "5d2a9c64-7e1b-4830-b6f5-9a3c1e8d7b02",
  "locationName": "Room 101 Bed 1",
  "patientId": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21",
  "patientName": "demo-resident",
  "floor": "1",
  "room": "101",
  "bed": "1"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `id` | `string (uuid)` | Device id. |
| `name` | `string` | Device name. Empty string when it has none. |
| `status` | `"active"` \| `"inactive"` \| `"entered-in-error"` \| `"unknown"` | Connection status. Left out when unknown. |
| `statusReason` | `object[]` | Why the platform marked the device, when it did. Empty array when nothing was recorded. |
| `statusReason[].code` | `string` | Reason code, such as `no-assigned-resident`. Stable. Render from this. |
| `statusReason[].display` | `string \| null` | A sentence for the code. `null` for a code that has none. |
| `thingsboardId` | `string` | Device identifier that telemetry is keyed by. Left out when the device has none. |
| `organizationId` | `string (uuid)` | Zone id. Left out when there is none. |
| `organizationName` | `string \| null` | Zone name. |
| `locationId` | `string (uuid)` | Location id. Left out when there is none. |
| `locationName` | `string \| null` | Location name. |
| `patientId` | `string (uuid)` | Resident id. Left out when there is none. |
| `patientName` | `string \| null` | The resident's full display name. |
| `floor` | `string` | Floor code of the location. Left out when not set. |
| `room` | `string` | Room code of the location. Left out when not set. |
| `bed` | `string` | Bed code of the location. Left out when not set. |

## Errors [#errors]

| Status | Meaning |
| --- | --- |
| [`401`](/errors/unauthenticated) | Bearer token is missing, invalid or expired. |
| [`403`](/errors/forbidden) | You are not a practitioner, admin or System Owner, or you lack `Device:read`. |
| [`404`](/errors/not-found) | No device with this `id` exists, or you cannot read it. |
| [`422`](/errors/validation-failed) | `id` is not a UUID. |
