Skip to content

SunCharts Connect API

Notifications

Connect API 1.1.0 11 operations openapi.json ↓

# My notifications

GET /api/v1/notifications

Notification feed, newest first. `unread_count` is the app badge.

Access End-user access token

Parameters

Name In Type Details
limit query integer
before query string (date-time)
unread query boolean

Responses

200 OK application/json
Fields NotificationList · 11
Field Type Details
notifications array of Notification
body string
category string one of messages, appointments, reminders, tasks, results, documents, security, system
created_at string (date-time)
id string (uuid)
kind string
read_at string or null
screen string one of inbox, schedule, chart, security, notifications
target object Detail view only: identifiers of what to open (connection_id, resource, resource_id, patient_uuid, item_key, session_id).
title string
unread_count integer
Example response placeholder values
{
  "notifications": [
    {
      "body": "string",
      "category": "messages",
      "created_at": "2026-01-15T15:30:00Z",
      "id": "00000000-0000-4000-8000-000000000000",
      "kind": "appointment.changed",
      "read_at": "2026-01-15T15:30:00Z",
      "screen": "inbox",
      "target": {}
    }
  ],
  "unread_count": 1
}
default Error (neutral code) application/json
Fields Error · 5
Field Type Details
error required string Stable machine code. Known values: `unauthorized`, `forbidden`, `not_found`, `bad_request`, `conflict`, `rate_limited`, `mfa_required`, `mfa_invalid`, `mfa_enrollment_required`, `openemr_link_required`, `openemr_relink_required`, `upstream_error`, `internal`. New codes may be added within v1: treat unknown values like the HTTP status.
connection_id string EHR connection that needs (re)linking (on `openemr_link_required` / `openemr_relink_required`)
link string How to link the connection (on `openemr_link_required` / `openemr_relink_required`)
message string Human-readable detail (do not branch on it; on 409 the text before the first `:` is a sub-code)
retry_after integer Seconds to wait (on `rate_limited`; also sent as `Retry-After`)

Example call

curl "https://sandbox-api.suncharts.app/api/v1/notifications" -H "Authorization: Bearer $TOKEN"

# Notification preferences

GET /api/v1/notifications/preferences

Per-category switches, quiet hours, timezone and reminder lead time.

Access End-user access token

Responses

200 OK application/json
Fields NotificationPreferences · 14
Field Type Details
categories object Per-category switch (all on by default). Partial updates allowed.
appointments boolean
documents boolean
messages boolean
reminders boolean
results boolean
security boolean
tasks boolean
quiet_hours object During quiet hours pushes arrive silently (no sound, low priority). Security alerts are never silenced.
enabled boolean
end string
start string
reminder_lead_minutes integer default 15value 5–240
timezone string or null IANA zone for quiet hours and reminders.
Example response placeholder values
{
  "categories": {
    "appointments": true,
    "documents": true,
    "messages": true,
    "reminders": true,
    "results": true,
    "security": true,
    "tasks": true
  },
  "quiet_hours": {
    "enabled": true,
    "end": "07:00",
    "start": "22:00"
  },
  "reminder_lead_minutes": 15,
  "timezone": "America/Chicago"
}
default Error (neutral code) application/json
Fields Error · 5
Field Type Details
error required string Stable machine code. Known values: `unauthorized`, `forbidden`, `not_found`, `bad_request`, `conflict`, `rate_limited`, `mfa_required`, `mfa_invalid`, `mfa_enrollment_required`, `openemr_link_required`, `openemr_relink_required`, `upstream_error`, `internal`. New codes may be added within v1: treat unknown values like the HTTP status.
connection_id string EHR connection that needs (re)linking (on `openemr_link_required` / `openemr_relink_required`)
link string How to link the connection (on `openemr_link_required` / `openemr_relink_required`)
message string Human-readable detail (do not branch on it; on 409 the text before the first `:` is a sub-code)
retry_after integer Seconds to wait (on `rate_limited`; also sent as `Retry-After`)

Example call

curl "https://sandbox-api.suncharts.app/api/v1/notifications/preferences" -H "Authorization: Bearer $TOKEN"

# Update notification preferences

PUT /api/v1/notifications/preferences

Partial update; only the fields sent change.

Access End-user access token

Request body application/json · required

Fields NotificationPreferences · 14
Field Type Details
categories object Per-category switch (all on by default). Partial updates allowed.
appointments boolean
documents boolean
messages boolean
reminders boolean
results boolean
security boolean
tasks boolean
quiet_hours object During quiet hours pushes arrive silently (no sound, low priority). Security alerts are never silenced.
enabled boolean
end string
start string
reminder_lead_minutes integer default 15value 5–240
timezone string or null IANA zone for quiet hours and reminders.
Example request body placeholder values
{
  "categories": {
    "appointments": true,
    "documents": true,
    "messages": true,
    "reminders": true,
    "results": true,
    "security": true,
    "tasks": true
  },
  "quiet_hours": {
    "enabled": true,
    "end": "07:00",
    "start": "22:00"
  },
  "reminder_lead_minutes": 15,
  "timezone": "America/Chicago"
}

Responses

200 OK application/json
Fields NotificationPreferences · 14
Field Type Details
categories object Per-category switch (all on by default). Partial updates allowed.
appointments boolean
documents boolean
messages boolean
reminders boolean
results boolean
security boolean
tasks boolean
quiet_hours object During quiet hours pushes arrive silently (no sound, low priority). Security alerts are never silenced.
enabled boolean
end string
start string
reminder_lead_minutes integer default 15value 5–240
timezone string or null IANA zone for quiet hours and reminders.
Example response placeholder values
{
  "categories": {
    "appointments": true,
    "documents": true,
    "messages": true,
    "reminders": true,
    "results": true,
    "security": true,
    "tasks": true
  },
  "quiet_hours": {
    "enabled": true,
    "end": "07:00",
    "start": "22:00"
  },
  "reminder_lead_minutes": 15,
  "timezone": "America/Chicago"
}
default Error (neutral code) application/json
Fields Error · 5
Field Type Details
error required string Stable machine code. Known values: `unauthorized`, `forbidden`, `not_found`, `bad_request`, `conflict`, `rate_limited`, `mfa_required`, `mfa_invalid`, `mfa_enrollment_required`, `openemr_link_required`, `openemr_relink_required`, `upstream_error`, `internal`. New codes may be added within v1: treat unknown values like the HTTP status.
connection_id string EHR connection that needs (re)linking (on `openemr_link_required` / `openemr_relink_required`)
link string How to link the connection (on `openemr_link_required` / `openemr_relink_required`)
message string Human-readable detail (do not branch on it; on 409 the text before the first `:` is a sub-code)
retry_after integer Seconds to wait (on `rate_limited`; also sent as `Retry-After`)

Example call

curl -X PUT "https://sandbox-api.suncharts.app/api/v1/notifications/preferences" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Mark all read

POST /api/v1/notifications/read-all

Clears the badge.

Access End-user access token

Responses

200 OK application/json
Fields UnreadCount · 1
Field Type Details
unread_count integer
Example response placeholder values
{
  "unread_count": 1
}
default Error (neutral code) application/json
Fields Error · 5
Field Type Details
error required string Stable machine code. Known values: `unauthorized`, `forbidden`, `not_found`, `bad_request`, `conflict`, `rate_limited`, `mfa_required`, `mfa_invalid`, `mfa_enrollment_required`, `openemr_link_required`, `openemr_relink_required`, `upstream_error`, `internal`. New codes may be added within v1: treat unknown values like the HTTP status.
connection_id string EHR connection that needs (re)linking (on `openemr_link_required` / `openemr_relink_required`)
link string How to link the connection (on `openemr_link_required` / `openemr_relink_required`)
message string Human-readable detail (do not branch on it; on 409 the text before the first `:` is a sub-code)
retry_after integer Seconds to wait (on `rate_limited`; also sent as `Retry-After`)

Example call

curl -X POST "https://sandbox-api.suncharts.app/api/v1/notifications/read-all" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Open a notification

GET /api/v1/notifications/{id}

One notification with its `target` identifiers (audited).

Access End-user access token

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 OK application/json
Fields Notification · 9
Field Type Details
body string
category string one of messages, appointments, reminders, tasks, results, documents, security, system
created_at string (date-time)
id string (uuid)
kind string
read_at string or null
screen string one of inbox, schedule, chart, security, notifications
target object Detail view only: identifiers of what to open (connection_id, resource, resource_id, patient_uuid, item_key, session_id).
title string
Example response placeholder values
{
  "body": "string",
  "category": "messages",
  "created_at": "2026-01-15T15:30:00Z",
  "id": "00000000-0000-4000-8000-000000000000",
  "kind": "appointment.changed",
  "read_at": "2026-01-15T15:30:00Z",
  "screen": "inbox",
  "target": {}
}
default Error (neutral code) application/json
Fields Error · 5
Field Type Details
error required string Stable machine code. Known values: `unauthorized`, `forbidden`, `not_found`, `bad_request`, `conflict`, `rate_limited`, `mfa_required`, `mfa_invalid`, `mfa_enrollment_required`, `openemr_link_required`, `openemr_relink_required`, `upstream_error`, `internal`. New codes may be added within v1: treat unknown values like the HTTP status.
connection_id string EHR connection that needs (re)linking (on `openemr_link_required` / `openemr_relink_required`)
link string How to link the connection (on `openemr_link_required` / `openemr_relink_required`)
message string Human-readable detail (do not branch on it; on 409 the text before the first `:` is a sub-code)
retry_after integer Seconds to wait (on `rate_limited`; also sent as `Retry-After`)

Example call

curl "https://sandbox-api.suncharts.app/api/v1/notifications/{id}" -H "Authorization: Bearer $TOKEN"

# Mark read

POST /api/v1/notifications/{id}/read

Returns the new badge count.

Access End-user access token

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 OK application/json
Fields UnreadCount · 1
Field Type Details
unread_count integer
Example response placeholder values
{
  "unread_count": 1
}
default Error (neutral code) application/json
Fields Error · 5
Field Type Details
error required string Stable machine code. Known values: `unauthorized`, `forbidden`, `not_found`, `bad_request`, `conflict`, `rate_limited`, `mfa_required`, `mfa_invalid`, `mfa_enrollment_required`, `openemr_link_required`, `openemr_relink_required`, `upstream_error`, `internal`. New codes may be added within v1: treat unknown values like the HTTP status.
connection_id string EHR connection that needs (re)linking (on `openemr_link_required` / `openemr_relink_required`)
link string How to link the connection (on `openemr_link_required` / `openemr_relink_required`)
message string Human-readable detail (do not branch on it; on 409 the text before the first `:` is a sub-code)
retry_after integer Seconds to wait (on `rate_limited`; also sent as `Retry-After`)

Example call

curl -X POST "https://sandbox-api.suncharts.app/api/v1/notifications/{id}/read" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Push configuration

GET /api/v1/push/config

Enabled push services and the Web Push VAPID key.

Access End-user access token

Responses

200 OK application/json
Fields PushConfig · 8
Field Type Details
apns_topics array of string Accepted APNs `app_id`s (bundle ids).
categories array of string
fcm_app_ids array of string
platforms object Which push services this server is configured to deliver to.
apns boolean
fcm boolean
webpush boolean
vapid_public_key string or null Web Push application server key (base64url), for `PushManager.subscribe`.
Example response placeholder values
{
  "apns_topics": [
    "string"
  ],
  "categories": [
    "messages"
  ],
  "fcm_app_ids": [
    "string"
  ],
  "platforms": {
    "apns": true,
    "fcm": true,
    "webpush": true
  },
  "vapid_public_key": "string"
}
default Error (neutral code) application/json
Fields Error · 5
Field Type Details
error required string Stable machine code. Known values: `unauthorized`, `forbidden`, `not_found`, `bad_request`, `conflict`, `rate_limited`, `mfa_required`, `mfa_invalid`, `mfa_enrollment_required`, `openemr_link_required`, `openemr_relink_required`, `upstream_error`, `internal`. New codes may be added within v1: treat unknown values like the HTTP status.
connection_id string EHR connection that needs (re)linking (on `openemr_link_required` / `openemr_relink_required`)
link string How to link the connection (on `openemr_link_required` / `openemr_relink_required`)
message string Human-readable detail (do not branch on it; on 409 the text before the first `:` is a sub-code)
retry_after integer Seconds to wait (on `rate_limited`; also sent as `Retry-After`)

Example call

curl "https://sandbox-api.suncharts.app/api/v1/push/config" -H "Authorization: Bearer $TOKEN"

# List my push devices

GET /api/v1/push/devices

Devices registered by the signed-in user (tokens are never returned).

Access End-user access token

Responses

200 OK application/json
Fields PushDeviceList · 11
Field Type Details
devices array of PushDevice
app_id string or null
app_version string or null
created_at string (date-time)
current_session boolean Registered from the session making this request.
device_name string or null
environment string one of sandbox, production
id string (uuid)
last_success_at string or null
platform string one of apns, fcm, webpush
updated_at string (date-time)
Example response placeholder values
{
  "devices": [
    {
      "app_id": "string",
      "app_version": "string",
      "created_at": "2026-01-15T15:30:00Z",
      "current_session": true,
      "device_name": "string",
      "environment": "sandbox",
      "id": "00000000-0000-4000-8000-000000000000",
      "last_success_at": "2026-01-15T15:30:00Z"
    }
  ]
}
default Error (neutral code) application/json
Fields Error · 5
Field Type Details
error required string Stable machine code. Known values: `unauthorized`, `forbidden`, `not_found`, `bad_request`, `conflict`, `rate_limited`, `mfa_required`, `mfa_invalid`, `mfa_enrollment_required`, `openemr_link_required`, `openemr_relink_required`, `upstream_error`, `internal`. New codes may be added within v1: treat unknown values like the HTTP status.
connection_id string EHR connection that needs (re)linking (on `openemr_link_required` / `openemr_relink_required`)
link string How to link the connection (on `openemr_link_required` / `openemr_relink_required`)
message string Human-readable detail (do not branch on it; on 409 the text before the first `:` is a sub-code)
retry_after integer Seconds to wait (on `rate_limited`; also sent as `Retry-After`)

Example call

curl "https://sandbox-api.suncharts.app/api/v1/push/devices" -H "Authorization: Bearer $TOKEN"

# Register a push token

POST /api/v1/push/devices

Register or refresh this device's push token for the signed-in user (idempotent per token; a token registered by another account moves to this one). Tokens are encrypted at rest and stop receiving pushes when the session that registered them signs out. Push payloads never contain PHI: they carry generic text, the notification `nid` and the `screen` to open (`suncharts://open?screen=…&nid=…`). After the user opens a push, fetch `GET /api/v1/notifications/{id}` for the target.

Access End-user access token

Request body application/json · required

Fields PushDeviceRegistration · 10
Field Type Details
platform required string one of apns, fcm, webpush
token required string APNs device token (hex), FCM registration token, or the Web Push subscription `endpoint` URL.
app_id string APNs topic / Android package. Defaults to the SunCharts app.
app_version string length ≤ 64
device_name string length ≤ 120
environment string APNs environment (development builds use `sandbox`). Ignored for FCM/Web Push. one of sandbox, productiondefault production
keys object Web Push only: `PushSubscription.toJSON().keys`.
auth required string
p256dh required string
locale string length ≤ 35
Example request body placeholder values
{
  "platform": "apns",
  "token": "string",
  "app_id": "string",
  "app_version": "string",
  "device_name": "string",
  "environment": "sandbox",
  "keys": {
    "auth": "string",
    "p256dh": "string"
  },
  "locale": "string"
}

Responses

201 Registered application/json
Fields PushDevice · 10
Field Type Details
app_id string or null
app_version string or null
created_at string (date-time)
current_session boolean Registered from the session making this request.
device_name string or null
environment string one of sandbox, production
id string (uuid)
last_success_at string or null
platform string one of apns, fcm, webpush
updated_at string (date-time)
Example response placeholder values
{
  "app_id": "string",
  "app_version": "string",
  "created_at": "2026-01-15T15:30:00Z",
  "current_session": true,
  "device_name": "string",
  "environment": "sandbox",
  "id": "00000000-0000-4000-8000-000000000000",
  "last_success_at": "2026-01-15T15:30:00Z"
}
default Error (neutral code) application/json
Fields Error · 5
Field Type Details
error required string Stable machine code. Known values: `unauthorized`, `forbidden`, `not_found`, `bad_request`, `conflict`, `rate_limited`, `mfa_required`, `mfa_invalid`, `mfa_enrollment_required`, `openemr_link_required`, `openemr_relink_required`, `upstream_error`, `internal`. New codes may be added within v1: treat unknown values like the HTTP status.
connection_id string EHR connection that needs (re)linking (on `openemr_link_required` / `openemr_relink_required`)
link string How to link the connection (on `openemr_link_required` / `openemr_relink_required`)
message string Human-readable detail (do not branch on it; on 409 the text before the first `:` is a sub-code)
retry_after integer Seconds to wait (on `rate_limited`; also sent as `Retry-After`)

Example call

curl -X POST "https://sandbox-api.suncharts.app/api/v1/push/devices" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Unregister a push token

POST /api/v1/push/devices/unregister

Remove a token (sign-out, permission revoked). Always 204.

Access End-user access token

Request body application/json · required

Fields PushUnregister · 2
Field Type Details
platform required string one of apns, fcm, webpush
token required string
Example request body placeholder values
{
  "platform": "apns",
  "token": "string"
}

Responses

204 Done
default Error (neutral code) application/json
Fields Error · 5
Field Type Details
error required string Stable machine code. Known values: `unauthorized`, `forbidden`, `not_found`, `bad_request`, `conflict`, `rate_limited`, `mfa_required`, `mfa_invalid`, `mfa_enrollment_required`, `openemr_link_required`, `openemr_relink_required`, `upstream_error`, `internal`. New codes may be added within v1: treat unknown values like the HTTP status.
connection_id string EHR connection that needs (re)linking (on `openemr_link_required` / `openemr_relink_required`)
link string How to link the connection (on `openemr_link_required` / `openemr_relink_required`)
message string Human-readable detail (do not branch on it; on 409 the text before the first `:` is a sub-code)
retry_after integer Seconds to wait (on `rate_limited`; also sent as `Retry-After`)

Example call

curl -X POST "https://sandbox-api.suncharts.app/api/v1/push/devices/unregister" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Remove a push device

DELETE /api/v1/push/devices/{id}

Remove one of my devices.

Access End-user access token

Parameters

Name In Type Details
id required path string (uuid)

Responses

204 Done
default Error (neutral code) application/json
Fields Error · 5
Field Type Details
error required string Stable machine code. Known values: `unauthorized`, `forbidden`, `not_found`, `bad_request`, `conflict`, `rate_limited`, `mfa_required`, `mfa_invalid`, `mfa_enrollment_required`, `openemr_link_required`, `openemr_relink_required`, `upstream_error`, `internal`. New codes may be added within v1: treat unknown values like the HTTP status.
connection_id string EHR connection that needs (re)linking (on `openemr_link_required` / `openemr_relink_required`)
link string How to link the connection (on `openemr_link_required` / `openemr_relink_required`)
message string Human-readable detail (do not branch on it; on 409 the text before the first `:` is a sub-code)
retry_after integer Seconds to wait (on `rate_limited`; also sent as `Retry-After`)

Example call

curl -X DELETE "https://sandbox-api.suncharts.app/api/v1/push/devices/{id}" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json