# List locations in a project (admin)

Canonical page: https://docs.ovok.com/slim-apis/location/list-locations-in-a-project-admin

| Method | Path |
| --- | --- |
| `GET` | `/v1/slim/location/admin/list` |

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

Lists the locations of a given project. The admin dashboard uses it to fill the location picker after you choose a project.

**Auth:** Bearer token. The caller must be a project admin. Super admins without the admin role, practitioners and System Owner callers are refused. The access-policy check (`Location:search`, `Location:read`) is skipped for admins.
**Scope:** The project named by the required `projectId` query parameter. The search runs with Ovok's admin client, not the caller's token.

## Request [#request]

### Query parameters [#query-parameters]

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | `string (uuid)` | Yes | Project to list locations of. |
| `page` | `integer` | No | Zero-based page number. Default `0`, minimum `0`. |
| `count` | `integer` | No | Rows per page. Default `50`, minimum `1`, maximum `100`. |

## Behaviour [#behaviour]

- Read-only.
- Locations are sorted by name.
- Pagination is zero-based: `page` (default `0`) and `count` (default `50`, max `100`).
- `total` is an estimate: when a page is full it is one more than the rows seen so far, so a full page means more may follow.
- Unlike `GET /v1/slim/location`, rows carry no device or resident fields: one row per location.

## Example [#example]

```bash
curl -X GET 'https://api.sandbox.ovok.com/v1/slim/location/admin/list?projectId=b7a3d915-6e20-4c8f-9a14-3d5f7b9c1e68&page=0&count=50' \
  -H "Authorization: Bearer ${OVOK_TOKEN}"
```

## Successful response [#successful-response]

`200` — Locations retrieved successfully.

```json
{
  "total": 1,
  "page": 0,
  "count": 50,
  "resources": [
    {
      "id": "5d2a9c64-7e1b-4830-b6f5-9a3c1e8d7b02",
      "name": "Room 18",
      "floor": "2",
      "room": "18",
      "organizationId": "1e6b8d30-2c4f-4a95-8d7e-b0a2c4e6f918",
      "organizationName": "Zone A"
    }
  ]
}
```

| Field | Type | Description |
| --- | --- | --- |
| `total` | `integer` | Estimated total. When the page is full, one more than the rows seen so far. |
| `page` | `integer` | Page number of this response. |
| `count` | `integer` | Page size of this response. |
| `resources` | `object[]` | The rows of this page, sorted by name. |
| `resources[].id` | `string (uuid)` | Location id. |
| `resources[].name` | `string` | Location name. Empty string when it has none. |
| `resources[].floor` | `string` | Floor code. Left out when not set. |
| `resources[].room` | `string` | Room code. Left out when not set. |
| `resources[].bed` | `string` | Bed code. Left out when not set. |
| `resources[].organizationId` | `string (uuid)` | Zone id. Left out when the location has no zone. |
| `resources[].organizationName` | `string` | Zone name. Left out when the location has no zone. |

## Errors [#errors]

| Status | Meaning |
| --- | --- |
| [`401`](/errors/unauthenticated) | Bearer token is missing, invalid or expired. |
| [`403`](/errors/forbidden) | You are not a project admin. |
| [`422`](/errors/validation-failed) | A query parameter fails validation. |
