Passer au contenu

Rate limits and retries

EDFlow rate limits per bucket, the RateLimit headers, which errors to retry and how, exponential backoff with jitter, idempotency keys, and batching and size limits.

Cette page n'est pas encore offerte en français; elle est affichée en anglais.

Rate limits

Token buckets, keyed by app unless stated. The platform can raise them for your app on request.

BucketApplies toRateBurst
ingest/v1/events*, /v1/fhir*, /v1/hl7v2, signed /ehr/v1/* (per source)20 requests/s40
readGET /v1/*20/s60
writeWrite-back and webhook management5/s20
sandbox/v1/sandbox/*1/s5
orgEverything, per organization100/s200
oauthToken/oauth/token per client30/min30

A busy ED produces tens of events per minute, so these limits are for backfills and runaway loops, not normal traffic.

Every response carries the IETF headers:

RateLimit-Policy: "read";q=60;w=3
RateLimit: "read";r=47;t=1

q is the bucket size and w the seconds to refill it; r is what's left and t the seconds until at least one more request is allowed. A 429 has Retry-After.

Retry or not

ResponseRetry?First
5xx, network error, timeout (use 30 s)YesBackoff
429YesWait Retry-After
401 token_expiredYesGet a new token
401 timestamp_out_of_window, delivery_replayedYesRe-sign (same event ids)
409 idempotency_in_progressYesWait a moment
Per-event processing_errorYesResend that event (same id)
Any other 4xx, per-event retryable: falseNoFix something first

Backoff

Exponential, starting at 1 s, doubling, capped at 300 s, with ±20% jitter. Keep retrying for up to 72 hours, then dead-letter locally and alert. Transient failures are always 503 or 429 with Retry-After, on every path, including raw HL7 (never an AR).

Idempotency

  • Events are idempotent by (source, event id) for 30 days. A retry with the same ids is always safe.
  • Other writes (write-back, webhook management, sandbox operations) require an Idempotency-Key header (1–255 characters; a UUID is recommended; never patient data). Keys last 24 hours.
    • Same key while the first is still running: 409 idempotency_in_progress.
    • Same key with a different request: 422 idempotency_key_reused.
    • Completed: the stored response is replayed with Idempotent-Replayed: true.
    • Errors before the handler ran (authentication, validation, 429) release the key so you can fix the request and retry with the same key.

Ordering

Send each feed through a single-threaded queue so events for a visit arrive roughly in order. EDFlow doesn't depend on it: events are applied by precedence, and events within one batch in array order.

Size and count limits

LimitValue
Request body512 KiB (HL7 JSON mode: 13 MiB)
POST /v1/events1 event, 32 KiB
POST /v1/events/batch1–100 events
FHIR Bundle200 entries
HL7JSON mode 50 messages; raw mode 1; each 256 KiB
List limit100
Webhook endpoints20 per app, 50 per organization per environment
Apps50 per organization per environment
Credentials per app2 client secrets, 10 API keys, 5 public keys
IP allowlist50 CIDR entries
Roster entries1,000

Dernière mise à jour le

Cette page vous a-t-elle été utile?

Sur cette page