Check the server's CapabilityStatement for subscription support; in FHIR R4 use the Subscription resource; in FHIR R4B/R5 the SubscriptionTopic resource provides more structured event definitions.
Create a Subscription resource via POST [base]/Subscription with criteria specifying the resource type and optional filter (e.g., 'Observation?patient=[id]&code=http://loinc.org|[code]'), channel.type of 'rest-hook', and channel.endpoint set to your HTTPS webhook URL.
Include channel.header with an Authorization header value your webhook endpoint will validate to authenticate incoming notifications from the FHIR server.
The server sends HTTP POST notifications to your endpoint when matching resources change; the notification body may be a minimal ping (empty Bundle), the changed resource, or a full payload depending on server configuration and Subscription.channel.payload setting.
Respond to webhook notifications with HTTP 200 within a few seconds; if processing takes longer, acknowledge immediately and process asynchronously to avoid notification retries.
Handle subscription lifecycle: check Subscription.status (requested → active → error); the server may transition to 'error' if your endpoint is unreachable; re-create or reactivate subscriptions after downtime.
Known gotchas
FHIR R4 Subscription criteria syntax is limited and inconsistently supported across servers; complex filtering may not be available and over-broad subscriptions may flood your endpoint.
Webhook endpoints must be reachable from the FHIR server over the internet with a valid TLS certificate; localhost or private network URLs will not work for production subscription channels.
Notification delivery is at-least-once; design your webhook handler to be idempotent, using the resource ID and version to detect and deduplicate repeated notifications.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp