Subscriptions R5 Backport
1.0.0 - ballot International flag

Subscriptions R5 Backport, published by HL7 FHIR Infrastructure WG. This is not an authorized publication; it is the continuous build for version 1.0.0). This version is based on the current content of and changes regularly. See the Directory of published versions


This section gives an overview of the workflow for both Servers and Clients to work with Subscriptions. Each channel MAY vary slightly from this general overview - specifically around interactions involving the Endpoint (e.g., when using a rest-hook the client must pre-configure an HTTP endpoint which the server validates, but when using websockets the client simply connects to the server).

Creating a Subscription

A workflow for creating a subscription is below:

FHIR ServerFHIR ServerClientClientEndpointServer Implementation1Implement core Subscription functionality2Implement topics and advertise viaSubscriptionTopicresourcesClient Implementation[Client Topic Discovery]3Search for a supportedSubscriptionTopic, e.g.:GET .../SubscriptionTopic?[params]4Bundlewith matchingSubscriptionTopicresources[Client Subscription Request]5Create, configure, or initializethe necessary EndpointEndpoint6Create a Subscription, e.g.:POST .../SubscriptionServer Accepting or Rejecting a Subscription[Valid Subscription, without Handshake]7Success: status =activeSend notifications...[Valid Subscription, with Handshake Success]8Success: status =requested9Handshake10Success, e.g.:200: OKUpdate Subscription:Subscription.status: activeSend notifications...[Valid Subscription, with Handshake Failure]11Success: status =requested12Handshake13Failure, e.g.:404: Not FoundUpdate Subscription:Subscription.status: error[Invalid Subscription]14Failure, e.g.:400: Bad RequestNo subscription was created
Sequence diagram of creating a FHIR Subscription
  1. Server implements the core functionality required for subscriptions (see Conformance).
  2. Server implements one or more SubscriptionTopic resources. Implementation is specific to each topic, and will vary between servers.
  3. Client asks the server for the list of supported SubscriptionTopic resources, via querying the resource.
  4. Server responds with a searchset Bundle.
  5. Client ensures that the endpoint is prepared (if applicable - see Channels).
  6. Client requests a Subscription (e.g., via POST, PUT, etc.).
  7. Server MAY accept the Subscription request and mark it active (e.g., supported channel and payload, no handshake required).
  8. Server MAY accept the Subscription request and mark it requested (e.g., supported channel and payload, handshake required).
  9. Server sends a handshake bundle to the endpoint.
  10. If the Endpoint responds appropriately, per the channel requirements (e.g., in REST an HTTP Success code such as 200), the Server updates the subscription to active.
  11. Server MAY accept the Subscription request and mark it requested (e.g., supported channel and payload, handshake required).
  12. Server sends a handshake bundle to the endpoint.
  13. If the handshake fails (e.g., connection failure, bad response, etc.), the Server updates the subscription to error.
  14. Server MAY reject the Subscription request (e.g., unsupported channel type).

Once the subscription is active, notifications will be sent according to the Channel. Note that error states may occur, see Handling Errors for more information.