REST API
v1.0.2
We provide an HTTP REST API to allow clients to manage patient sessions. All endpoints of this API can be called using the access token generated by the client ID-secret pair. Please see the Authentication guide to learn more about how to generate the access token.
A patient session represents the period between patient admittance and the patient leaving the room after discharge. During this period, Ouva services read from any related camera streams. A patient session typically consists of the department, room, sensor, and patient info and can be uniquely identified by a reference key (UUID).
Here are the endpoints we publicly expose:

REST API Endpoints
- GET
/api/v1/patient-sessions/{sessionReferenceKey}
:- This can be used to fetch a patient session by its reference key.
- PUT
/api/v1/patient-sessions/{sessionReferenceKey}
:- Updates an ongoing patient session.
- This can be used to update any session related (department, room, sensor, patient) info.
- DELETE
/api/v1/patient-sessions/{sessionReferenceKey}
:- Ends an ongoing patient session.
- This can be called when the patient session ends (i.e. Patient is discharged and left the room)
- PATCH
/api/v1/patient-sessions/{sessionReferenceKey}
:- Partially updates an ongoing patient session.
- This can be used to partially update any session related (department, room, sensor, patient) info.
- POST
/api/v1/patient-sessions
:- Creates/starts a patient session.
- This can be used to start the session when a patient is admitted to a room.
- Additionally, this creates any (department, room, sensor, patient) info related to the session, if necessary.
All API endpoints are secured and requires an access token embedded in theBearer
request header.

PatientSessionDTO

PatientDTO

RoomDTO

SensorDTO
Additionally, we share this OpenAPI YAML so that you can further examine the details. Any OpenAPI-compliant editor such as Swagger can be used to do so (and to even generate some example client code in various languages).
openapi: 3.0.1
info:
version: v1
title: ouva-patient
description: REST API documentation for ouva-patient.
servers:
- url: https://customername.ouva.dev/rest-api/v1/patient-sessions
description: Generated server url
paths:
/api/v1/patient-sessions/{sessionReferenceKey}:
get:
tags:
- patient-session-rest-controller
summary: Get an active patient session by its reference key
operationId: get
parameters:
- name: sessionReferenceKey
in: path
required: true
schema:
type: string
responses:
'200':
description: OK
content:
'*/*':
schema:
$ref: '#/components/schemas/PatientSessionDTO'
security:
- bearer-key: []
put:
tags:
- patient-session-rest-controller
summary: Updates an ongoing patient session.
operationId: put
parameters:
- name: sessionReferenceKey
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PatientSessionDTO'
required: true
responses:
'200':
description: OK
content:
'*/*':
schema:
type: object
security:
- bearer-key: []
delete:
tags:
- patient-session-rest-controller
summary: Deletes/ends an ongoing patient session. This doesn't delete related department, room, sensor & patient data
operationId: delete
parameters:
- name: sessionReferenceKey
in: path
required: true
schema:
type: string
responses:
'200':
description: OK
security:
- bearer-key: []
patch:
tags:
- patient-session-rest-controller
summary: Partially updates an ongoing patient session. (e.g. This can be used to toggle standby flag)
operationId: patch
parameters:
- name: sessionReferenceKey
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PatientSessionDTO'
required: true
responses:
'200':
description: OK
content:
'*/*':
schema:
type: object
security:
- bearer-key: []
/api/v1/patient-sessions:
post:
tags:
- patient-session-rest-controller
summary: Creates/starts a patient session. This will also create related department, room, sensor & patient data if necessary.
operationId: create
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PatientSessionDTO'
required: true
responses:
'200':
description: OK
content:
'*/*':
schema:
type: object
security:
- bearer-key: []
components:
schemas:
PatientDTO:
required:
- dateOfBirth
- name
- surname
- referenceKey
type: object
properties:
referenceKey:
maxLength: 255
minLength: 1
type: string
description: A unique identifier (UUID) for the patient.
example: 363d557d-ef14-4c4f-a39f-c3c130f47100
name:
maxLength: 255
minLength: 1
type: string
description: Patient name.
example: Tom
surname:
maxLength: 255
minLength: 1
type: string
description: Patient surname.
example: Hanks
dateOfBirth:
type: string
description: Patient date of birth in ISO-8601 format (yyyy-MM-dd)
format: date
example: '1990-06-12'
fallRisk:
type: boolean
description: Fall risk flag. (Setting this flag true enables fall risk notifications)
default: false
description: Related patient
PatientSessionDTO:
required:
- patient
- room
type: object
properties:
referenceKey:
type: string
description: A unique identifier (UUID) for the patient session. (This can be used for any subsequent endpoint call)
readOnly: true
example: 363d557d-ef14-4c4f-a39f-c3c130f47100
standby:
type: boolean
description: Standby flag. (Setting this flag true puts the session in standby mode. Resetting it to false makes the session resume)
default: false
readOnly: true
patient:
$ref: '#/components/schemas/PatientDTO'
room:
$ref: '#/components/schemas/RoomDTO'
RoomDTO:
required:
- departmentName
- roomNumber
- sensor
type: object
properties:
roomNumber:
maxLength: 255
minLength: 1
type: string
description: Room identifier (e.g. room number)
departmentName:
type: string
description: Related department
sensor:
$ref: '#/components/schemas/SensorDTO'
description: Related room
SensorDTO:
required:
- resolutionHeight
- resolutionWidth
- url
type: object
properties:
url:
maxLength: 255
minLength: 1
type: string
description: WebRTC URL with credentials. Credentials will be safely stored.
example: http://<>.customername.net:3443/socket.io/?client-type=ouva&camera-name=<>
resolutionWidth:
type: integer
description: Resolution width.
format: int32
example: 1280
default: 1280
resolutionHeight:
type: integer
description: Resolution height.
format: int32
example: 720
default: 720
description: Related sensor / camera
securitySchemes:
bearer-key:
type: http
scheme: bearer
bearerFormat: JWT
Here is a
cURL
example to start a patient session with related (patient, room, department, sensor) info:curl -k -H "Content-Type: application/json" -X POST -d '{ "patient": { "referenceKey": "363d557d-ef14-4c4f-a39f-c3c130f47100", "name": "John", "surname": "Doe", "dateOfBirth": "1990-06-12", "fallRisk": true }, "room": { "roomNumber": "webrtc-demo", "departmentName": "Test", "sensor": { "url": "webrtc://<URL>/?camera_id=<CAM_ID>", "resolutionWidth": 1280, "resolutionHeight": 720 } } }' -H "Authorization: Bearer <TOKEN>" https://customername.ouva.dev/rest-api/v1/patient-sessions/
Here is a
cURL
example to end a patient session:curl -k -X DELETE -H "Authorization: Bearer <TOKEN>" https://customername.ouva.dev/rest-api/v1/patient-sessions/<SESSION_REFERENCE_KEY>/
Last modified 6d ago