Locations
Create location in a project (admin)
Create location in a project (admin) using Ovok’s Slim API.
| 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 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.
Request
Body
The body is strict: a field that is not listed here fails validation.
| Name | Type | Required | Description |
|---|---|---|---|
projectId | string (uuid) | Yes | Project to create the location in. |
name | string | Yes | Location name. At least 1 character. |
floor | string | No | Floor code. |
room | string | No | Room code. |
bed | string | No | Bed code. |
organizationId | string (uuid) | No | Zone the location belongs to. |
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. - A location-created entry is added to the change history of the target project. A failure to write that entry does not fail the request.
- 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": "b7a3d915-6e20-4c8f-9a14-3d5f7b9c1e68",
"name": "Room 18",
"floor": "2",
"room": "18",
"organizationId": "1e6b8d30-2c4f-4a95-8d7e-b0a2c4e6f918"
}'Successful response
201 — Location created successfully.
{
"id": "5d2a9c64-7e1b-4830-b6f5-9a3c1e8d7b02",
"name": "Room 18",
"projectId": "b7a3d915-6e20-4c8f-9a14-3d5f7b9c1e68"
}| Field | Type | Description |
|---|---|---|
id | string (uuid) | Id of the created location. |
name | string | Name of the created location. |
projectId | string (uuid) | Project the location was created in. |
Errors
Last updated on