Set your endpoint
Each API key has one webhook endpoint. Set it in Docistra (Settings > Integrations > API, under the key) or through the API:secret (whsec_...), only this once. An empty events list means every event. The URL must be https:// and reachable from the internet.
What arrives
data.object is the record as it is when the webhook is sent, in the same shape as the API’s GET. data.previous says what changed.
Your endpoint should
- Check the signature before trusting the body. See Verify signatures.
- Answer 2xx within 10 seconds. Do heavy work after answering (a queue).
- Dedupe on
X-Docistra-Event-Id. A retry carries the same id, so store the ids you processed. - Not rely on order. Two changes a second apart can arrive in either order. Compare
updated_atwith what you have.
Retries
Anything other than a 2xx (or no answer within 10 seconds) is retried after 1 minute, 5 minutes, 15 minutes, 1 hour, 3 hours, 6 hours and 12 hours. After that the event is marked failed. Catch up withupdated_since if your endpoint was down longer.
The clinic sees each delivery (delivered, retrying, failed, with the HTTP status) under the key in Docistra, and can send a test event with Send test. A test event has the type ping.
Your own changes don’t come back
A change your own API call made is not sent back to the same key’s endpoint. If you cancel an appointment through the API, you don’t getappointment.cancelled for it. Changes made in Docistra, or with another key, are sent.