Skip to content

SunCharts EHR API

Booking and intake

EHR API as of 26.11.11.41 12 operations openapi.json ↓

# Read an enabled practice public-booking profile

GET /api/public/v1/booking/{slug}

Access No credential

Parameters

Name In Type Details
slug required path string

Responses

200 Public booking profile
404 Profile unavailable

Example call

curl -X GET "$EHR_URL/api/public/v1/booking/{slug}"

# Request an appointment and optionally receive a one-time intake URL

POST /api/public/v1/booking/{slug}

Always creates a provisional patient identity for staff review; it never merges against an existing chart. The requested time must match the practice timezone, weekdays, hours and slot cadence. Provider conflicts, booking horizon and per-contact request limits are enforced atomically.

Access No credential

Parameters

Name In Type Details
slug required path string

Request body application/json · required

Fields object · 7
Field Type Details
birth_date required string (date)
email required string (email)
family_name required string length ≤ 100
given_name required string length ≤ 100
phone required string length ≤ 40
request_id required string (uuid)
starts_at required string (date-time)
Example request body placeholder values
{
  "birth_date": "2026-01-15",
  "email": "[email protected]",
  "family_name": "string",
  "given_name": "string",
  "phone": "string",
  "request_id": "00000000-0000-4000-8000-000000000000",
  "starts_at": "2026-01-15T15:30:00Z"
}

Responses

200 Idempotent replay
201 Appointment request recorded
409 Time unavailable, request reused with different content, or rate limited

Example call

curl -X POST "$EHR_URL/api/public/v1/booking/{slug}"

# Send the practice's intake form to a patient, with or without an appointment

POST /api/v1/patients/{patient}/intake-forms

Owner, clinician or front desk with clinical access. Issues the practice's default form (the standard form when nothing is saved) and returns its link once. The link works for 30 days, or through the day of the appointment when that is later. A default form the patient has not sent in yet is cancelled in the same transaction when it is for the same appointment or for none; forms for other appointments keep their links. No message is sent by the server.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
patient required path string (uuid)

Request body application/json · required

Fields object · 1
Field Type Details
appointment_id string or null
Example request body placeholder values
{
  "appointment_id": "00000000-0000-4000-8000-000000000000"
}

Responses

201 packet_id, patient_id, one-time intake_url, secret_shown_once, expires_at and replaced (forms cancelled). Cache-Control no-store.
400 The appointment does not belong to this patient.
404 Patient is not in the authorized tenant.
409 The appointment already has a filled-in form.

Example call

curl -X POST "$EHR_URL/api/v1/patients/{patient}/intake-forms" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# List retained patient intake forms across all appointment dates and statuses

GET /api/v1/patients/{patient}/intake-packets

Requires staff clinical-view access. Audited patient- and tenant-scoped metadata only: packet identity/version/status, immutable template revision name, nullable appointment context, submitted/reviewed times, expires_at, expired, started_at, default_form, response-presence flag, and all-history counts. No answers, attestation, access token or token hash. Existing packet detail reads authorize answer access separately. Does not change review status or chart data.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
patient required path string (uuid)
after query string (uuid) Packet cursor belonging to this patient; newest-issued ordering is stable.
limit query integer

Responses

200 {patient_id,items,next_cursor,summary:{total,submitted,reviewed,cancelled}}; Cache-Control: no-store.
400 Invalid page limit or cursor outside this patient.
403 Clinical-view access is not granted.
404 Patient is not in the authorized tenant.

Example call

curl "$EHR_URL/api/v1/patients/{patient}/intake-packets" -H "Authorization: Bearer $ACCESS_TOKEN"

# Read a tenant-scoped intake packet and latest submitted answers

GET /api/v1/previsit/packets/{id}

Returns packet_id, packet_version, status, created_at, nullable expires_at and expired, immutable template_snapshot, patient identity (patient_identity: given_name, family_name, birth_date for side-by-side comparison), nullable appointment_id/starts_at, attested_name, response and nullable workflow_instance_id/workflow_step_key/workflow_definition_version. Never returns the link secret or saved progress.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Packet detail; Cache-Control no-store.
404 Packet not found in the authenticated tenant.

Example call

curl "$EHR_URL/api/v1/previsit/packets/{id}" -H "Authorization: Bearer $ACCESS_TOKEN"

# Cancel an intake form the patient has not sent in

POST /api/v1/previsit/packets/{id}/cancel

Only a default form in status sent or in_progress can be cancelled. The link stops working at once, saved progress is removed and the form is kept as cancelled (void) with the reason in its history. Workflow forms are managed from their patient journey.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)
If-Match required header string

Request body application/json · required

Fields object · 1
Field Type Details
reason required string length 1–500
Example request body placeholder values
{
  "reason": "string"
}

Responses

200 packet_id, status void and the new version.
404 Form not found in the authenticated tenant.
409 Stale version, already filled in or cancelled, or a workflow form.

Example call

curl -X POST "$EHR_URL/api/v1/previsit/packets/{id}/cancel" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Apply explicitly selected mapped answers from a reviewed intake packet

POST /api/v1/previsit/packets/{id}/demographics

Only immutable field chart_target values demographics.preferred_name, pronouns, language, administrative_gender, phone, email, address.line1, address.line2, address.city, address.region, address.postal_code, emergency_contact.name, emergency_contact.relationship and emergency_contact.phone are supported; name and date of birth are never changed here. Only the selected fields change; every other chart field is kept. Values come from the stored response, never caller-supplied values. Native validation, current demographics version, history and intake provenance apply atomically. No signed clinical content changes.

Access OAuth 2.0 access tokenclinical.write

Parameters

Name In Type Details
id required path string (uuid)
If-Match required header string

Request body application/json · required

Fields object · 3
Field Type Details
demographics_version required integer value ≥ 0
fields required array of string items 1–14
reason required string length 1–800
Example request body placeholder values
{
  "demographics_version": 0,
  "fields": [
    "string"
  ],
  "reason": "string"
}

Responses

200 packet_id, patient_id, new demographics version and content; ETag is the new version.
400 Unsupported mapping, empty answer or invalid native contact field.
403 Native role, clinical edit policy or OAuth scope denied.
409 Packet is not reviewed, packet version changed, or demographics version changed.

Example call

curl -X POST "$EHR_URL/api/v1/previsit/packets/{id}/demographics" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Attest staff review of a submitted packet

POST /api/v1/previsit/packets/{id}/review

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)
If-Match required header string

Responses

200 Review event committed
409 Packet not submitted or stale

Example call

curl -X POST "$EHR_URL/api/v1/previsit/packets/{id}/review" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# List upcoming intake readiness for the authenticated tenant

GET /api/v1/previsit/readiness

Access OAuth 2.0 access tokenclinical.read

Responses

200 Up to 200 upcoming packets and latest patient-submitted response

Example call

curl "$EHR_URL/api/v1/previsit/readiness" -H "Authorization: Bearer $ACCESS_TOKEN"

# Read tenant booking and active intake configuration

GET /api/v1/previsit/settings

Access OAuth 2.0 access tokenclinical.read

Responses

200 profile, template (null until the practice saves or first sends a form), intake_mode (standard or own) and standard, the read-only standard intake form.

Example call

curl "$EHR_URL/api/v1/previsit/settings" -H "Authorization: Bearer $ACCESS_TOKEN"

# Create or replace public-booking configuration

PUT /api/v1/previsit/settings

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
If-Match required header string

Responses

200 Versioned configuration saved
403 Owner role required
409 Stale version or slug conflict

Example call

curl -X PUT "$EHR_URL/api/v1/previsit/settings" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Create or revise a bounded intake template

POST /api/v1/previsit/templates

schema.base "standard" asks the standard steps first and then the practice's own sections (which may be empty); without base the saved sections are the whole form. Optional per field: help, show_if {key, equals} or {key, any_of}, option_labels, autocomplete, inputmode, format, max_length. Optional per section: intro, show_if, skippable, skip_label. A show_if rule may name only an earlier question. Also optional per field: lookup (insurer or pharmacy) with id_key naming a hidden field that keeps the picked record's reference, hidden, and other_key naming the text field that holds what the patient wrote for "Other". required_with names an earlier question; the field is required only once that question has an answer.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
If-Match required header string

Responses

201 Versioned template saved
400 Invalid or unbounded schema
403 Owner role required

Example call

curl -X POST "$EHR_URL/api/v1/previsit/templates" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json