Skip to content

SunCharts Connect API

Partner account and clinics

Connect API 1.1.0 8 operations openapi.json ↓

# Your app's white-label auth settings

GET /api/v1/partner/auth-settings

Access OAuth 2.0 access tokenpartner.read X-API-Key header Partner token or API key (Bearer)partner.read X-Partner-Authorization header

Responses

200 OK application/json
Fields AuthSettings · 8
Field Type Details
android_cert_sha256 array of string
apple_app_ids array of string
auth_origin string or null
custom_domain_verified boolean
email_delivery string one of platform, partner
email_link_base string or null
platform_delivery_available boolean
rp_id string or null
Example response placeholder values
{
  "android_cert_sha256": [
    "AB:CD:…"
  ],
  "apple_app_ids": [
    "ABCDE12345.com.example.app"
  ],
  "auth_origin": "https://app.example.com",
  "custom_domain_verified": true,
  "email_delivery": "platform",
  "email_link_base": "https://app.example.com/auth/link?t={token}",
  "platform_delivery_available": true,
  "rp_id": "example.com"
}
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 -s https://sandbox-api.suncharts.app/api/v1/partner/auth-settings -H "Authorization: Bearer $TOKEN"

# Update your app's auth settings (omitted = unchanged, ""/[] = clear)

PATCH /api/v1/partner/auth-settings

Access OAuth 2.0 access tokenapps.manage X-API-Key header Partner token or API key (Bearer)apps.manage OAuth 2.0 access tokenusers.passthrough X-Partner-Authorization header

Request body application/json · required

Fields AuthSettings · 8
Field Type Details
android_cert_sha256 array of string
apple_app_ids array of string
auth_origin string or null
custom_domain_verified boolean
email_delivery string one of platform, partner
email_link_base string or null
platform_delivery_available boolean
rp_id string or null
Example request body placeholder values
{
  "android_cert_sha256": [
    "AB:CD:…"
  ],
  "apple_app_ids": [
    "ABCDE12345.com.example.app"
  ],
  "auth_origin": "https://app.example.com",
  "custom_domain_verified": true,
  "email_delivery": "platform",
  "email_link_base": "https://app.example.com/auth/link?t={token}",
  "platform_delivery_available": true,
  "rp_id": "example.com"
}

Responses

200 Updated application/json
Fields AuthSettings · 8
Field Type Details
android_cert_sha256 array of string
apple_app_ids array of string
auth_origin string or null
custom_domain_verified boolean
email_delivery string one of platform, partner
email_link_base string or null
platform_delivery_available boolean
rp_id string or null
Example response placeholder values
{
  "android_cert_sha256": [
    "AB:CD:…"
  ],
  "apple_app_ids": [
    "ABCDE12345.com.example.app"
  ],
  "auth_origin": "https://app.example.com",
  "custom_domain_verified": true,
  "email_delivery": "platform",
  "email_link_base": "https://app.example.com/auth/link?t={token}",
  "platform_delivery_available": true,
  "rp_id": "example.com"
}
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 -s -X PATCH https://sandbox-api.suncharts.app/api/v1/partner/auth-settings \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"auth_origin":"https://app.example.com","rp_id":"example.com","email_delivery":"partner"}'

# Partner, branding and app identity (scope partner.read)

GET /api/v1/partner/me

Access OAuth 2.0 access tokenpartner.read X-API-Key header Partner token or API key (Bearer)partner.read X-Partner-Authorization header

Responses

200 OK application/json
Fields PartnerMe · 14
Field Type Details
app object
client_id string
id string
scopes array of string
branding object
custom_domain string or null
email_from_name string or null
logo_url string or null
primary_color string or null
support_email string or null
partner object
id string
name string
slug string
Example response placeholder values
{
  "app": {
    "client_id": "string",
    "id": "string",
    "scopes": [
      "string"
    ]
  },
  "branding": {
    "custom_domain": "string",
    "email_from_name": "string",
    "logo_url": "string",
    "primary_color": "string",
    "support_email": "string"
  },
  "partner": {
    "id": "string",
    "name": "string",
    "slug": "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 -s https://sandbox-api.suncharts.app/api/v1/partner/me -H "Authorization: Bearer $TOKEN"

# Partner-scoped tenants (clinics)

GET /api/v1/partner/tenants

Access OAuth 2.0 access tokentenants.read X-API-Key header Partner token or API key (Bearer)tenants.read X-Partner-Authorization header

Responses

200 OK application/json
Fields TenantPage · 11
Field Type Details
tenants required array of Tenant
id required string (uuid)
name required string
slug required string
status required string one of active, suspended
data array of Tenant Same as `tenants` (kept for early v1 clients).
id required string (uuid)
name required string
slug required string
status required string one of active, suspended
next_cursor string or null Reserved for pagination; currently always null (every tenant is returned in one page).
Example response placeholder values
{
  "tenants": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "string",
      "slug": "string",
      "status": "active"
    }
  ],
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "string",
      "slug": "string",
      "status": "active"
    }
  ],
  "next_cursor": "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 -s https://sandbox-api.suncharts.app/api/v1/partner/tenants -H "Authorization: Bearer $TOKEN"

# Create a partner-scoped tenant

POST /api/v1/partner/tenants

Access OAuth 2.0 access tokentenants.write X-API-Key header Partner token or API key (Bearer)tenants.write X-Partner-Authorization header

Request body application/json · required

Fields NewTenant · 2
Field Type Details
name required string
slug required string pattern ^[a-z0-9][a-z0-9-]{1,62}$
Example request body placeholder values
{
  "name": "string",
  "slug": "string"
}

Responses

200 Created application/json
Fields Tenant · 4
Field Type Details
id required string (uuid)
name required string
slug required string
status required string one of active, suspended
Example response placeholder values
{
  "id": "00000000-0000-4000-8000-000000000000",
  "name": "string",
  "slug": "string",
  "status": "active"
}
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/partner/tenants" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json

# Invite a user to one of your tenants

POST /api/v1/partner/tenants/{tid}/invites

Replaces any outstanding invite for the same email. `409` if the email already has an account in the tenant. Delivery follows your app's `email_delivery` (see *White-label auth relay*).

Access OAuth 2.0 access tokentenants.write X-API-Key header Partner token or API key (Bearer)tenants.write X-Partner-Authorization header

Parameters

Name In Type Details
tid required path string (uuid)

Request body application/json · required

Fields NewInvite · 3
Field Type Details
email required string
display_name string
role string default clinician
Example request body placeholder values
{
  "email": "string",
  "display_name": "string",
  "role": "clinician"
}

Responses

200 OK application/json
Fields Invite · 15
Field Type Details
delivery required InviteDelivery `transport: partner` → we sent nothing; deliver `url` (or build your own from `token`). Otherwise the mail transport's result.
code string or null Always null for invites (there is no code to enter)
delivered boolean
email string
expires_in_mins integer
purpose constant always invite
token string
transport string
url string
email required string
expires_at required string (date-time)
id required string (uuid)
invite_url required string On your `auth_origin` for partner tenants
role required string
app_link string
Example response placeholder values
{
  "delivery": {
    "code": "string",
    "delivered": true,
    "email": "string",
    "expires_in_mins": 1,
    "purpose": "invite",
    "token": "string",
    "transport": "string",
    "url": "string"
  },
  "email": "string",
  "expires_at": "2026-01-15T15:30:00Z",
  "id": "00000000-0000-4000-8000-000000000000",
  "invite_url": "string",
  "role": "string",
  "app_link": "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 -s https://sandbox-api.suncharts.app/api/v1/partner/tenants/$TENANT_ID/invites \
  -H "X-Partner-Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","role":"clinician"}'

# Users of one of your tenants

GET /api/v1/partner/tenants/{tid}/users

Access OAuth 2.0 access tokentenants.read X-API-Key header Partner token or API key (Bearer)tenants.read X-Partner-Authorization header

Parameters

Name In Type Details
tid required path string (uuid)

Responses

200 OK application/json
Fields TenantUsers · 7
Field Type Details
users required array of TenantUser
email required string
id required string (uuid)
role required string owner | clinician | front_desk | read_only (new roles may be added)
status required string active | deactivated
created_at string (date-time)
display_name string or null
Example response placeholder values
{
  "users": [
    {
      "email": "string",
      "id": "00000000-0000-4000-8000-000000000000",
      "role": "string",
      "status": "string",
      "created_at": "2026-01-15T15:30:00Z",
      "display_name": "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 -s https://sandbox-api.suncharts.app/api/v1/partner/tenants/$TENANT_ID/users -H "X-Partner-Authorization: Bearer $TOKEN"

# Deactivate a tenant user

POST /api/v1/partner/tenants/{tid}/users/{uid}/deactivate

Signs the user out everywhere and drops their EHR links. Idempotent. `409` if it would leave the tenant without an active owner.

Access OAuth 2.0 access tokentenants.write X-API-Key header Partner token or API key (Bearer)tenants.write X-Partner-Authorization header

Parameters

Name In Type Details
tid required path string (uuid)
uid required path string (uuid)

Responses

200 OK application/json
Fields object · 3
Field Type Details
id string
role string
status constant always deactivated
Example response placeholder values
{
  "id": "string",
  "role": "string",
  "status": "deactivated"
}
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/partner/tenants/{tid}/users/{uid}/deactivate" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @body.json