Errors, limits and retries
Error bodies, rate limits, paging and how to retry safely.
Error bodies
Both APIs answer errors with the same small JSON body:
{"error": "not_found", "message": "..."}
| Status | SunCharts EHR | Connect |
|---|---|---|
| 400 | invalid |
bad_request |
| 401 | unauthorized |
unauthorized |
| 403 | forbidden |
forbidden |
| 404 | not_found |
not_found |
| 409 | conflict |
conflict |
| 428 | version_required |
EHR link required |
| 429 | Public intake pages only | rate_limited |
| 503 | unavailable: nothing changed, safe to retry |
Retry reads only |
FHIR routes on the EHR answer with an OperationOutcome
instead. OAuth endpoints use the standard OAuth error codes.
Rate limits
- SunCharts EHR. There is no general API rate limit and there are no rate-limit headers. The public intake and booking pages have their own limits.
-
Connect.
600 requests a minute per app by default, shared by its tokens and keys. The token endpoint allows 30 requests a minute per address. Over the limit you receive 429 with
Retry-After. There are noX-RateLimitheaders.
Retrying safely
- Neither API has an
Idempotency-Keyrequest header. -
SunCharts EHR.
Creates take a
request_idin the body. Sending the same id again is safe; the same id with different content returns 409. Updates needIf-Matchwith the version you read. Do not retry a write blindly. -
Connect.
Wait for
Retry-Afteron 429. Retry 502, 503 and 504 only forGET,PUTandDELETE, with backoff, at most three times. Do not replay sign-inPOSTcalls.
Paging
- EHR FHIR searches:
_countand the Bundle'snextlink. - EHR change notices:
afterandnext_cursor. - Other EHR lists are bounded and say when there is more. Do not treat one page as the whole chart.