Skip to content

Polling vs. webhooks

There are two ways to learn about changes in Thea.

Webhooks Polling with updated_since
Latency Seconds Your polling interval
Rate-limit cost None One request per page, per interval
Needs a public HTTPS endpoint Yes No
Can miss changes Yes, if your endpoint is down for over 24 hours No
  1. Subscribe to webhooks for the events your product reacts to, and fetch the resource when one arrives.
  2. Run a periodic sync with updated_since (hourly or nightly) to reconcile anything a webhook didn’t deliver, for example after an outage on your side.

Because both paths fetch the current resource and upsert by id, it doesn’t matter which one sees a change first.

If you can’t receive webhooks (for example, inside a hospital network with no inbound access), poll:

  • For each connected practice, GET /cases?updated_since=<last checkpoint> with its practice key every 1–5 minutes.
  • Fetch GET /cases/{case_id}/messages only for cases whose updated_at changed.

At a one-minute interval, that’s well inside the rate limits for most practices. See Pagination for a sync loop.