Skip to content

Guides

Events and webhooks

Change notices, the event stream and signed scheduling webhooks.

Applies to the SunCharts EHR API. The Connect partner API has no webhooks.

Change notices

GET /api/v1/events lists what changed in the practice, oldest first. Needs events.read.

  • A notice carries a reference, not the record: an id, an action, the resource id and a time. Fetch the record separately.
  • Up to 100 notices per page. Pass the returned cursor as after to continue.
  • latest=true returns the current cursor without replaying history.
  • Actions cover patients, appointments, visits, imports, AI drafts and workflow items. Reads are not recorded as notices.

Event stream

GET /api/v1/events/stream delivers the same notices as Server-Sent Events.

  • Event names are clinical.change, ai.change and workflow.change.
  • The event id is the cursor. Reconnect with Last-Event-ID to resume.
  • The stream ends when your token expires, which is every 5 minutes for an OAuth access token. Reconnect with a fresh token.
  • Expect reconnects and duplicates, and handle both.

Scheduling webhooks

An owner can subscribe an HTTPS endpoint to appointment changes with POST /api/v1/scheduling/webhooks (scheduling.write).

  • Events: appointment.created, appointment.changed, appointment.cancelled.
  • The endpoint must be public HTTPS. Redirects are not followed.
  • The signing secret (sce_whsec_…) is returned once, when the subscription is created.
  • Any 2xx response counts as delivered. Otherwise delivery is retried up to 8 times, starting at 30 seconds and doubling to at most one hour.

Verify every delivery before trusting it:

SunCharts-Timestamp: 1767225600
SunCharts-Signature: v1=<hex HMAC-SHA256(signing secret, "<timestamp>.<raw body>")>

Each delivery also carries SunCharts-Event-Id, SunCharts-Event-Type, SunCharts-Delivery-Id and an Idempotency-Key equal to the event id. Use it to ignore repeats.