Skip to main content

Get realtime trends graphs

MethodPath
GET/v1/slim/trends/realtime

Authentication · Access policies

Returns the same trend data as GET /v1/slim/trends/graphs, in the same shape, but read from the resident's readings in Signals instead of from Medplum Observations. Use it for the recent, live part of a chart.

Auth: bearer token. The caller must be a practitioner, an admin or a System Owner, and needs Organization:read, Device:read, Patient:read and DocumentReference:read. Scope: the resident must be in the caller's project or one of its sub-projects (not its parent). A resident outside that scope answers 404, the same as one that does not exist.

Behaviour​

  • The chart covers exactly [startTime, endTime]. Unlike /graphs, it does not snap to monitoring days.
  • A window of up to 24 hours has 30-second buckets. A longer one has 5-minute buckets, each the mean of its readings. Buckets sit on a UTC-aligned grid and each covers the interval up to its timestamp, so the last bucket can end up to one bucket after endTime.
  • Readings are charted under the resident's most recently assigned device, with the same device key, threshold and baseline values and stats as /graphs. Signals readings carry no device, so a resident whose device changed inside the window shows one device key here where /graphs shows one per device.
  • Every graph type in the table below can be charted. Only heartRate and respiratoryRate carry threshold and baseline values.
  • endTime must not be earlier than 24 hours ago, startTime must not be after endTime, and the window may span at most 14 days. A request that breaks one of these fails validation.
  • Readings are charted by when they were observed, or by when Signals stored them when no observed time exists. Late-arriving readings are included.
  • A resident with no assigned device, or with no readings in the window, returns every requested graph type as {} (and heartRate and respiratoryRate as {}).
  • If Signals cannot be reached, does not answer within 25 seconds, or holds more readings than one request can page through, the route returns 503 with error: "signals_unavailable" and a retryAfterSec value, rather than a partial or empty chart.
  • Results are cached for up to 15 seconds, and the request times are rounded down to that interval for the cache key, so a repeated poll can show a window up to 15 seconds old.

Graph types​

Each type charts every Signals reading recorded under one of its codes. The names are the dashboard telemetry's, so pulse rate by pulse oximetry is pulseRate and never part of heartRate.

graphTypeCodes
heartRate8867-4, 43149-4
respiratoryRate9279-1
oxygenSaturation59408-5, 2708-6
pulseRate8889-8 (heart rate by pulse oximetry)
perfusionIndex61006-3, PI (Kinderspitex's own vital code, not LOINC)
bodyTemperature8310-5
systolicBloodPressure8480-6
diastolicBloodPressure8462-4
heartRateVariability80404-7

Example cURL request​

curl -X GET \
'https://api.sandbox.ovok.com/v1/slim/trends/realtime?patientId=3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21&startTime=2026-09-27T09:00:00Z&endTime=2026-09-28T09:00:00Z&graphType=heartRate,respiratoryRate' \
-H "Authorization: Bearer ${OVOK_TOKEN}"

Successful response​

200 — Successfully retrieved realtime trends data grouped by device and graph type

Errors​

StatusMeaning
400Your session has no project.
401Bearer token is missing, invalid or expired.
403You are not a practitioner, admin or System Owner, or you lack Organization:read, Device:read, Patient:read or DocumentReference:read.
404No resident with this patientId exists in your project or its sub-projects.
422A query parameter fails validation, startTime is after endTime, endTime is more than 24 hours ago, or the window is longer than 14 days.