Writes and the change feed described below are live for inventory (any plan with API access);
for patients, appointments, clinical notes and drug requests, a write also needs the clinic’s API
add-on and an accepted API data agreement — see the index page.
Webhooks are set up from the developer dashboard’s Webhooks page — see
Verifying a webhook’s signature.
Idempotency keys — for writes
Every write endpoint (anything that creates, adjusts, or changes a record — receiving stock, adjusting a quantity, transferring between locations, creating an item, uploading a code list) accepts anIdempotency-Key header.
- If the original write never reached the server, the retry is the first attempt — it goes through normally.
- If the original write already succeeded, the retry returns the same result it returned the first time
(
idempotent_replay: truein the response) and changes nothing a second time. You will never end up with a duplicated stock movement or a doubled adjustment from retrying.
The sequence number — for webhooks
Every webhook carries aseq — a number that only ever goes up, counted separately for each clinic (and, for an event about your workspace itself, for your workspace).
Store the highest seq you’ve successfully processed. It’s your one source of truth for “have I seen this
already”, independent of whether the delivery itself arrived once, twice, or out of order under retry.
webhook-id header, and a retry or replay of the same event
carries the same id (with a fresh timestamp and signature).
The change feed — catching up after downtime
If your endpoint was down, disabled, or you simply missed a delivery, don’t try to reconstruct what changed from memory — page through the change feed instead, starting after the lastseq you have. The feed is per clinic —
after_seq is the query parameter:
next_after until it stops advancing. The feed only ever returns event types your key’s current
scopes cover — if a scope was removed since an event was queued, that event simply will not appear, the same as if
it had never happened for you.