Create location in a project (admin)
- Sandbox: available
- Staging: available
- Production: unknown
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,roomandbedare stored as type codes.organizationIdsets 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
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" }'bearerAuthorizationBearer <JWT>application/json- body
projectId*stringuuidname*string1 <= lengthfloor?stringroom?stringbed?stringorganizationId?stringuuidLocation created successfully.
application/json- response
id*stringId of the created location.
name*stringName of the created location.
projectId*stringProject the location was created in.
curl -X POST 'https://api.sandbox.ovok.com/v1/slim/location/admin' \ -H 'Content-Type: application/json' \ -d '{ "projectId": "5a8591dd-4039-49df-9202-96385ba3eff8", "name": "string"}'{ "id": "string", "name": "string", "projectId": "string"}List locations in a project (admin) GET
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` (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 ```bash 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' ```
Get location GET
Returns one location (room or bed) by id, with its zone, devices and resident. **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:read` (an admin or super admin who holds no access policy skips this check). **Scope:** The location is read with the caller's own token, so you get any location your Medplum access lets you read. There is no extra project check on this route. ## Behaviour - Read-only. - `floor`, `room` and `bed` come from the location's type codes. - `organizationId` and `organizationName` are the location's zone (`Location.managingOrganization`). - `deviceId` lists every device at the location. `deviceName` is the alphabetically first of their names. - `patientId` and `patientName` are the resident on the first device at the location that has one. - Fields with no value are omitted. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/slim/location/c3499c27-2973-0a7f-807e-fb8676a92dcb' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ``` ```json { "id": "c3499c27-2973-0a7f-807e-fb8676a92dcb", "name": "Room 201", "floor": "2", "room": "201", "bed": "A", "organizationId": "87ea5dfc-8b8e-384d-8489-79496e706390", "organizationName": "Ward A", "deviceId": ["..."], "deviceName": "...", "patientId": "...", "patientName": "Maxi" } ```