Skip to main content
Docistra changes all day without your system: the AI agent registers patients and books on WhatsApp, patients book on the clinic’s page, reception cancels and checks people in. Webhooks send you each change as it happens.

Set your endpoint

Each API key has one webhook endpoint. Set it in Docistra (Settings > Integrations > API, under the key) or through the API:
The response includes the signing 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

  1. Check the signature before trusting the body. See Verify signatures.
  2. Answer 2xx within 10 seconds. Do heavy work after answering (a queue).
  3. Dedupe on X-Docistra-Event-Id. A retry carries the same id, so store the ids you processed.
  4. Not rely on order. Two changes a second apart can arrive in either order. Compare updated_at with 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 with updated_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 get appointment.cancelled for it. Changes made in Docistra, or with another key, are sent.