List locations in a project (admin)
- Sandbox: available
- Staging: available
- Production: unknown
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 Medplum 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 only for an admin who holds no access policy.
Scope: The project named by the required projectId query parameter. The search runs with Ovok's admin client, not the caller's token.
Behaviour
- Read-only.
- Locations are sorted by name.
- Pagination is zero-based:
page(default0) andcount(default50, max100). totalis 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
curl -X GET 'https://api.sandbox.ovok.com/v1/slim/location/admin/list?projectId=c3499c27-2973-0a7f-807e-fb8676a92dcb&page=0&count=50' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'bearerAuthorizationBearer <JWT>projectId*stringuuidcount?string"50"page?string"0"Locations retrieved successfully.
application/json- response
total*numberEstimated total: one more than the rows seen so far when this page is full.
page*numbercount*numberresources*array<>curl -X GET 'https://api.sandbox.ovok.com/v1/slim/location/admin/list?projectId=497f6eca-6276-4993-bfeb-53cbbbba6f08'{ "total": 0, "page": 0, "count": 0, "resources": [ { "id": "string", "name": "string", "floor": "string", "room": "string", "bed": "string", "organizationId": "string", "organizationName": "string" } ]}Create location POST
Creates a location (room or bed), optionally in a zone. **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 `Location:create` and `Device:update` (an admin or super admin who holds no access policy skips this check). **Scope:** The location is created in the caller's project (from the token). A super-admin caller can pass `?projectId=<uuid>` to create it in that project instead. Any other caller who passes `projectId` gets a 403. ## Behaviour - `name` must be unique. The check is an exact name match against the locations your token can search. With `?projectId`, the check runs in that project only. - When any of `floor`, `room` or `bed` is set, the combination of zone, floor, room and bed must also be unique. The comparison ignores case and extra whitespace. A location with only a name has no such check. - `floor`, `room` and `bed` are stored as type codes on the location. `organizationId` sets the zone. The zone must be in your project, one of its sub-projects, or its parent project. - The create is guarded against a concurrent create of the same floor, room and bed. If another request creates it first, you get a 409 that names the existing location. - No devices or residents are attached. Use `PUT /v1/slim/location/{id}` for that. - A location-created entry is added to the change history. A failure to write that entry does not fail the request. - The response is the created location, in the same shape as `GET /v1/slim/location/{id}`. - If a location with the same zone, floor, room and bed exists, the request is refused with 409 and the body carries `existingLocationId` and `existingLocationName`. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/v1/slim/location' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "name": "Room 201", "floor": "2", "room": "201", "bed": "A", "organizationId": "87ea5dfc-8b8e-384d-8489-79496e706390" }' ```
Create location in a project (admin) POST
Creates a location in a given project. The admin dashboard uses it during device assignment, when the right room does not exist yet. **Auth:** Bearer token. The caller must be a Medplum project admin. Super admins without the admin role, practitioners and System Owner callers are refused. The access-policy check (`Location:create`) is skipped only for an admin who holds no access policy. **Scope:** The project named by `projectId` in the body. The location is created with Ovok's admin client and stamped with that project. ## Behaviour - `floor`, `room` and `bed` are stored as type codes. `organizationId` sets the zone (`managingOrganization`). - The location is created with `status: active`. - Unlike `POST /v1/slim/location`, this route does not check for a duplicate name or a duplicate floor, room and bed, and adds no change-history entry. - The response is `{ id, name, projectId }` of the created location. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/v1/slim/location/admin' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "projectId": "c3499c27-2973-0a7f-807e-fb8676a92dcb", "name": "Room 18", "floor": "2", "room": "18", "organizationId": "87ea5dfc-8b8e-384d-8489-79496e706390" }' ```