Create location in a project (admin)
| Method | Path |
|---|---|
POST | /v1/slim/location/admin |
Authentication · Access policies
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 for admins.
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 ${OVOK_TOKEN}" \
-H 'Content-Type: application/json' \
-d '{
"projectId": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21",
"name": "Room 18",
"floor": "2",
"room": "18",
"organizationId": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21"
}'
Successful response
201 — Location created successfully.
Errors
| Status | Meaning |
|---|---|
400 | Medplum refuses the location. |
401 | Bearer token is missing, invalid or expired. |
403 | You are not a Medplum admin. |
422 | The body fails validation. |