# Get zone detail

Canonical page: https://docs.ovok.com/slim-apis/zones/get-zone-detail

| Method | Path |
| --- | --- |
| `GET` | `/v1/slim/zones/:zoneId` |

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

Returns one zone with all of its locations and the devices and residents assigned to each location. A zone is a FHIR `Organization`. Use it for a zone drill-down view.

**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:read` and `Location:read` (admins and super admins skip this check).
**Scope:** The zone must belong to the caller's project (from the token), its parent project, or one of its sub-projects.

## Request [#request]

### Path parameters [#path-parameters]

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `zoneId` | `string (uuid)` | Yes | Zone (organization) id. |

## Behaviour [#behaviour]

- Returns every location whose managing organization is the zone; there is no paging.
- Each location carries `floor`, `room` and `bed` when set, and its `devices` and `residents`. Devices and residents are sorted by name in natural order (so "Bed 2" sorts before "Bed 10").
- A location with no devices has empty `devices` and `residents` lists.

## Example [#example]

```bash
curl -X GET 'https://api.sandbox.ovok.com/v1/slim/zones/1e6b8d30-2c4f-4a95-8d7e-b0a2c4e6f918' \
  -H "Authorization: Bearer ${OVOK_TOKEN}"
```

## Successful response [#successful-response]

`200` — Zone detail with nested locations, devices and residents.

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

| Field | Type | Description |
| --- | --- | --- |
| `id` | `string (uuid)` | Zone id. |
| `name` | `string` | Zone name. |
| `locations` | `object[]` | Every location in the zone. |
| `locations[].id` | `string (uuid)` | Location id. |
| `locations[].name` | `string` | Location name. |
| `locations[].floor` | `string` | Floor code. Left out when not set. |
| `locations[].room` | `string` | Room code. Left out when not set. |
| `locations[].bed` | `string` | Bed code. Left out when not set. |
| `locations[].devices` | `object[]` | Devices at the location, sorted by name. Empty array when there are none. |
| `locations[].devices[].id` | `string (uuid)` | Device id. |
| `locations[].devices[].name` | `string` | Device name. Left out when it has none. |
| `locations[].residents` | `object[]` | Residents on those devices, once each, sorted by name. Empty array when there are none. |
| `locations[].residents[].id` | `string (uuid)` | Patient id. |
| `locations[].residents[].name` | `string` | The resident's Resident ID (nickname). Left out when the resident has no name. |

## 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, you lack `Organization:read` or `Location:read`, your session has no project, or the zone is outside your project tree or carries no project. |
| [`404`](/errors/not-found) | No zone with this `zoneId` exists. |
| [`422`](/errors/validation-failed) | `zoneId` is not a UUID. |
