Skip to content

SunCharts Connect API

End-user sign-in

Connect API 1.1.0 20 operations openapi.json ↓

# Approve or deny a device code for your account

POST /api/v1/auth/device/approve

Needs a full (non-display, non-watch) user session. Full-access grants require Face ID/Touch ID (`user_verified`) on Apple or a passkey (`ceremony_id` + `credential` from POST /uv/start) on the web. `404` when the code is unknown, expired or already decided.

Access End-user access token

Request body application/json · required

Fields DeviceApproveRequest · 5
Field Type Details
user_code required string Case and separators are ignored.
approve boolean `false` denies the request. default true
ceremony_id string (uuid) Web: from POST /uv/start.
credential object Web: WebAuthn PublicKeyCredential JSON from the passkey assertion.
user_verified boolean Apple first-party apps set true after Face ID / Touch ID / device passcode.
Example request body placeholder values
{
  "user_code": "string",
  "approve": true,
  "ceremony_id": "00000000-0000-4000-8000-000000000000",
  "credential": {},
  "user_verified": true
}

Responses

200 OK application/json
Fields DeviceRequestInfo · 14
Field Type Details
access string one of display, full
browser string
client string one of tv, watch, ios, ipados, macos, web, android
country string
created_at string (date-time)
device_name string
expires_at string (date-time)
ip string
kind string one of request, offer
kind_label string
location string Rough location (country) from the edge (Cloudflare).
status string approve only one of approved, denied
user_agent string
user_code string
Example response placeholder values
{
  "access": "display",
  "browser": "string",
  "client": "tv",
  "country": "string",
  "created_at": "2026-01-15T15:30:00Z",
  "device_name": "string",
  "expires_at": "2026-01-15T15:30:00Z",
  "ip": "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 -X POST "https://sandbox-api.suncharts.app/api/v1/auth/device/approve" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Type the code shown on a signed-in device

POST /api/v1/auth/device/claim

Anonymous. Returns a `device_code` to poll with POST /token. The signed-in device must then confirm. 5 wrong well-formed codes burn the offer.

Access No credential

Request body application/json · required

Fields DeviceClaimRequest · 3
Field Type Details
client required string one of ios, ipados, macos, web, android
user_code required string
device_name string length ≤ 80
Example request body placeholder values
{
  "client": "ios",
  "user_code": "string",
  "device_name": "string"
}

Responses

200 OK application/json
Fields DeviceClaim · 8
Field Type Details
device_code required string
interval required integer
client string
expires_at string (date-time)
expires_in integer
kind string one of request, offer
status string
user_code string
Example response placeholder values
{
  "device_code": "string",
  "interval": 1,
  "client": "string",
  "expires_at": "2026-01-15T15:30:00Z",
  "expires_in": 1,
  "kind": "request",
  "status": "string",
  "user_code": "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 -X POST "https://sandbox-api.suncharts.app/api/v1/auth/device/claim" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Describe a pending device code before approving it

GET /api/v1/auth/device/lookup

What a pending code would sign in, including device type, browser, IP and rough location (country). Full session required (not TV or Watch).

Access End-user access token

Parameters

Name In Type Details
user_code required query string

Responses

200 OK application/json
Fields DeviceRequestInfo · 14
Field Type Details
access string one of display, full
browser string
client string one of tv, watch, ios, ipados, macos, web, android
country string
created_at string (date-time)
device_name string
expires_at string (date-time)
ip string
kind string one of request, offer
kind_label string
location string Rough location (country) from the edge (Cloudflare).
status string approve only one of approved, denied
user_agent string
user_code string
Example response placeholder values
{
  "access": "display",
  "browser": "string",
  "client": "tv",
  "country": "string",
  "created_at": "2026-01-15T15:30:00Z",
  "device_name": "string",
  "expires_at": "2026-01-15T15:30:00Z",
  "ip": "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/auth/device/lookup" -H "Authorization: Bearer $TOKEN"

# Current offer and any claiming device

GET /api/v1/auth/device/offer

Once claimed, includes the new device's type, browser, IP and rough location so you can confirm it isn't a shoulder-surfed code.

Access End-user access token

Responses

200 OK application/json
Fields DeviceOfferStatus · 16
Field Type Details
access string one of display, full
browser string
claimed boolean
client string one of tv, watch, ios, ipados, macos, web, android
country string
device_name string
expires_at string (date-time)
expires_in integer
ip string
kind string one of offer
kind_label string
location string
user_agent string
user_code string
verification_uri string (uri)
verification_uri_complete string (uri)
Example response placeholder values
{
  "access": "display",
  "browser": "string",
  "claimed": true,
  "client": "tv",
  "country": "string",
  "device_name": "string",
  "expires_at": "2026-01-15T15:30:00Z",
  "expires_in": 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/auth/device/offer" -H "Authorization: Bearer $TOKEN"

# Show a code on this signed-in device

POST /api/v1/auth/device/offer

Mints (or reuses) a 3-minute offer code. The new device POST /claim with it; this device then GET /offer and POST /approve after seeing type/browser/IP/location.

Access End-user access token

Responses

200 OK application/json
Fields DeviceStart · 9
Field Type Details
expires_in required integer
interval required integer
user_code required string Show this on the device.
verification_uri required string (uri)
access string one of display, full
client string one of tv, watch, ios, ipados, macos, web, android
device_code string Secret; poll with it. Never display it. Omitted on POST /offer (returned later from /claim).
kind string one of request, offer
verification_uri_complete string (uri) verification_uri with the code prefilled (QR code).
Example response placeholder values
{
  "expires_in": 180,
  "interval": 5,
  "user_code": "BCDF-2345",
  "verification_uri": "https://connect.suncharts.app/device",
  "access": "display",
  "client": "tv",
  "device_code": "string",
  "kind": "request"
}
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/auth/device/offer" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Start a device sign-in (show a code + QR)

POST /api/v1/auth/device/start

RFC 8628-style device authorization. `client` is tv (display scope, 5 min), watch, ios, ipados, macos, web or android (full access, 3 min). Show `user_code` and a QR of `verification_uri_complete`. A signed-in full-session device approves it, then poll POST /token. Rate-limited per IP.

Access No credential

Request body application/json · required

Fields DeviceStartRequest · 2
Field Type Details
client required string `tv` = clinic display (display scope, 5 min). `watch` / `ios` / `ipados` / `macos` / `web` / `android` = full session (3 min). one of tv, watch, ios, ipados, macos, web, android
device_name string Shown on the approval screen and in the user's device list. length ≤ 80
Example request body placeholder values
{
  "client": "tv",
  "device_name": "string"
}

Responses

200 OK application/json
Fields DeviceStart · 9
Field Type Details
expires_in required integer
interval required integer
user_code required string Show this on the device.
verification_uri required string (uri)
access string one of display, full
client string one of tv, watch, ios, ipados, macos, web, android
device_code string Secret; poll with it. Never display it. Omitted on POST /offer (returned later from /claim).
kind string one of request, offer
verification_uri_complete string (uri) verification_uri with the code prefilled (QR code).
Example response placeholder values
{
  "expires_in": 180,
  "interval": 5,
  "user_code": "BCDF-2345",
  "verification_uri": "https://connect.suncharts.app/device",
  "access": "display",
  "client": "tv",
  "device_code": "string",
  "kind": "request"
}
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/auth/device/start" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Poll a device sign-in

POST /api/v1/auth/device/token

`200` with `status` `authorization_pending`/`slow_down` while waiting; `200` `approved` with session tokens once (single use). `403` when the user denied it, `409` (`expired_token:` sub-code) when the code is unknown, expired or already used — start again. A `tv` session has `scope: display`: it can call only `/api/v1/display/*`, `/api/v1/me` and sign-out.

Access No credential

Request body application/json · required

Fields DeviceTokenRequest · 1
Field Type Details
device_code required string
Example request body placeholder values
{
  "device_code": "string"
}

Responses

200 Pending, or the new device session application/json
Fields DeviceTokenPoll · 15
Field Type Details
status required string one of authorization_pending, slow_down, approved
access_token string
client string one of tv, watch, ios, ipados, macos, web, android
display_name string
expires_at string (date-time)
expires_in integer
interval integer
refresh_token string
role string
scope string
session_id string (uuid)
tenant_id string (uuid)
tenant_name string
token_type string
user_id string (uuid)
Example response placeholder values
{
  "status": "authorization_pending",
  "access_token": "string",
  "client": "tv",
  "display_name": "string",
  "expires_at": "2026-01-15T15:30:00Z",
  "expires_in": 1,
  "interval": 1,
  "refresh_token": "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 -X POST "https://sandbox-api.suncharts.app/api/v1/auth/device/token" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Start passkey user-verification for a full-access approve

POST /api/v1/auth/device/uv/start

Web clients must complete this WebAuthn assertion (user verification required) and send `ceremony_id` + `credential` on POST /approve. Apple apps use local Face ID instead.

Access End-user access token

Responses

200 OK application/json
Fields PasskeyChallenge · 2
Field Type Details
ceremony_id string (uuid)
options object WebAuthn request options (publicKey).
Example response placeholder values
{
  "ceremony_id": "00000000-0000-4000-8000-000000000000",
  "options": {}
}
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/auth/device/uv/start" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# End-user sign-in (passthrough from the partner backend)

POST /api/v1/auth/login

Password sign-in, limited to emails in the deployment's SUNCHARTS_PASSWORD_LOGIN_ALLOWLIST (by default only the App Review account). Any other email gets 403 `passwordless_only`, the same answer whether or not the account exists; use passkeys or email codes. May be removed entirely on a deployment (404).

Access No credential

Parameters

Name In Type Details
X-Partner-Authorization header string White-label relay: `Bearer <pt_… token | sk_… key>` of the partner app (scope users.passthrough). Applies the app's auth settings.
X-End-User-IP header string Relay only: the end user's IP for rate limiting.

Request body application/json · required

Fields LoginRequest · 7
Field Type Details
email required string
password required string
device_name string
recovery_code string
tenant string DEPRECATED. Clinic code is no longer needed: the email is looked up across clinics. If sent, it only narrows the clinics the credentials already prove; any mismatch returns the same generic 401.
tenant_id string (uuid) Optional: choose this clinic when the account belongs to several.
totp string
Example request body placeholder values
{
  "email": "string",
  "password": "string",
  "device_name": "string",
  "recovery_code": "string",
  "tenant": "string",
  "tenant_id": "00000000-0000-4000-8000-000000000000",
  "totp": "string"
}

Responses

200 Session, or a clinic selection when the email belongs to several clinics application/json

Body: UserTokens or ClinicSelection

Example response placeholder values
{
  "access_token": "string",
  "expires_in": 1,
  "refresh_token": "string",
  "scope": "string",
  "token_type": "string"
}
401 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`)
403 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`)
429 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`)
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/auth/login" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Finish a multi-clinic sign-in

POST /api/v1/auth/login/select

Access No credential

Request body application/json · required

Fields SelectClinicRequest · 5
Field Type Details
selection_token required string
tenant_id required string (uuid)
device_name string
recovery_code string
totp string
Example request body placeholder values
{
  "selection_token": "string",
  "tenant_id": "00000000-0000-4000-8000-000000000000",
  "device_name": "string",
  "recovery_code": "string",
  "totp": "string"
}

Responses

200 Session, or a clinic selection when the email belongs to several clinics application/json

Body: UserTokens or ClinicSelection

Example response placeholder values
{
  "access_token": "string",
  "expires_in": 1,
  "refresh_token": "string",
  "scope": "string",
  "token_type": "string"
}
401 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`)
429 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`)
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/auth/login/select" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Revoke the current session

POST /api/v1/auth/logout

Access End-user access token

Responses

200 OK
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/auth/logout" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Finish passkey sign-in → user tokens

POST /api/v1/auth/passkey/login/finish

Body: `ceremony_id`, `credential` (PublicKeyCredential JSON), optional `tenant_id`, `device_name`.

Access No credential

Parameters

Name In Type Details
X-Partner-Authorization header string White-label relay: `Bearer <pt_… token | sk_… key>` of the partner app (scope users.passthrough). Applies the app's auth settings.
X-End-User-IP header string Relay only: the end user's IP for rate limiting.

Request body application/json · required

Body: object

Responses

200 OK application/json
Fields UserTokens · 5
Field Type Details
access_token required string
expires_in required integer
refresh_token required string
scope string Narrowed session scope. `display` = PHI-free clinic display session (only `/api/v1/display/*`); absent/null = full access.
token_type string
Example response placeholder values
{
  "access_token": "string",
  "expires_in": 1,
  "refresh_token": "string",
  "scope": "string",
  "token_type": "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 -X POST "https://sandbox-api.suncharts.app/api/v1/auth/passkey/login/finish" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Begin passkey sign-in (WebAuthn options)

POST /api/v1/auth/passkey/login/start

Returns `ceremony_id` and `options` (publicKey request). Relay: partner RP ID/origins.

Access No credential

Parameters

Name In Type Details
X-Partner-Authorization header string White-label relay: `Bearer <pt_… token | sk_… key>` of the partner app (scope users.passthrough). Applies the app's auth settings.
X-End-User-IP header string Relay only: the end user's IP for rate limiting.

Request body application/json · required

Body: object

Responses

200 OK application/json

Body: object

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/auth/passkey/login/start" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Finish passkey registration

POST /api/v1/auth/passkey/register/finish

Access End-user access token

Parameters

Name In Type Details
X-Partner-Authorization header string White-label relay: `Bearer <pt_… token | sk_… key>` of the partner app (scope users.passthrough). Applies the app's auth settings.
X-End-User-IP header string Relay only: the end user's IP for rate limiting.

Request body application/json · required

Body: object

Responses

200 OK application/json

Body: object

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/auth/passkey/register/finish" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Begin passkey registration (user token required)

POST /api/v1/auth/passkey/register/start

Access End-user access token

Parameters

Name In Type Details
X-Partner-Authorization header string White-label relay: `Bearer <pt_… token | sk_… key>` of the partner app (scope users.passthrough). Applies the app's auth settings.
X-End-User-IP header string Relay only: the end user's IP for rate limiting.

Request body application/json · required

Body: object

Responses

200 OK application/json

Body: object

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/auth/passkey/register/start" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Rotate the refresh token

POST /api/v1/auth/refresh

Access No credential

Request body application/json · required

Fields RefreshRequest · 1
Field Type Details
refresh_token required string
Example request body placeholder values
{
  "refresh_token": "string"
}

Responses

200 Session application/json
Fields UserTokens · 5
Field Type Details
access_token required string
expires_in required integer
refresh_token required string
scope string Narrowed session scope. `display` = PHI-free clinic display session (only `/api/v1/display/*`); absent/null = full access.
token_type string
Example response placeholder values
{
  "access_token": "string",
  "expires_in": 1,
  "refresh_token": "string",
  "scope": "string",
  "token_type": "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 -X POST "https://sandbox-api.suncharts.app/api/v1/auth/refresh" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Current user, tenant, role

GET /api/v1/me

Access End-user access token

Responses

200 OK application/json

Body: Me

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/me" -H "Authorization: Bearer $TOKEN"

# Passwordless sign-up: email + clinic name → link/code

POST /api/v1/signup/start

Body: `email`, `clinic_name`, `accept_terms`, `terms_version`, `device_nonce`, optional `display_name`. Relay + partner delivery returns `delivery`.

Access No credential

Parameters

Name In Type Details
X-Partner-Authorization header string White-label relay: `Bearer <pt_… token | sk_… key>` of the partner app (scope users.passthrough). Applies the app's auth settings.
X-End-User-IP header string Relay only: the end user's IP for rate limiting.

Request body application/json · required

Body: object

Responses

202 OK application/json
Fields MagicSent · 11
Field Type Details
code_length integer
delivery object or null Partner email delivery only: the secret to deliver to the user (never present without X-Partner-Authorization).
code string or null 6-digit code (null for signup_verify)
email string
expires_in_mins integer
purpose string one of signin, signup, signup_verify
token string
expires_in integer
message string
resend_after integer
status string
Example response placeholder values
{
  "code_length": 1,
  "delivery": {
    "code": "string",
    "email": "string",
    "expires_in_mins": 1,
    "purpose": "signin",
    "token": "string"
  },
  "expires_in": 1,
  "message": "string",
  "resend_after": 1,
  "status": "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 -X POST "https://sandbox-api.suncharts.app/api/v1/signup/start" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json