Locations

Create location in a project (admin)

Create location in a project (admin) using Ovok’s Slim API.

MethodPath
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.

NameTypeRequiredDescription
projectIdstring (uuid)YesProject to create the location in.
namestringYesLocation name. At least 1 character.
floorstringNoFloor code.
roomstringNoRoom code.
bedstringNoBed code.
organizationIdstring (uuid)NoZone the location belongs to.

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.
  • 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"
}
FieldTypeDescription
idstring (uuid)Id of the created location.
namestringName of the created location.
projectIdstring (uuid)Project the location was created in.

Errors

StatusMeaning
400The FHIR backend refuses the location.
401Bearer token is missing, invalid or expired.
403You are not a project admin.
422The body fails validation.

Last updated on

On this page