---
type: "resource-definitions"
title: "Subscription Definitions"
resource: "Subscription"
---
# Subscription Definitions
## Subscription
Information about a request for notifications to a client based on a SubscriptionTopic
**Definition:** The subscription resource describes a particular client's request to be notified about a SubscriptionTopic.
**Aliases:** WebHook, Hook, Routing Rule
**Cardinality:** 0..*
**Mappings:** rim=N/A; w5=infrastructure.exchange
## Subscription.identifier
Additional identifiers (business identifier)
**Definition:** A formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance.
**Cardinality:** 0..*
**Type:** [Identifier](/Identifier)
**Summary:** true
**Mappings:** w5=FiveWs.identifier
## Subscription.name
Human readable name for this subscription
**Definition:** A natural language name identifying the subscription.
**Cardinality:** 0..1
**Type:** [string](/string)
**Summary:** true
## Subscription.status
requested | active | error | off | entered-in-error
**Definition:** The status of the subscription, which marks the server state for managing the subscription.
**Comments:** A client can only submit subscription resources in the requested or off state. Only the server can move a subscription from requested to active, and then to error. Either the server or the client can turn a subscription off.
This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid.
**Cardinality:** 1..1
**Type:** [code](/code)
**Binding:** required:[subscription-status](/valueset-subscription-status)
**Summary:** true
**Is Modifier:** true (Reason: This element is labelled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid)
**Mappings:** w5=FiveWs.status
## Subscription.topic
Reference to the subscription topic being subscribed to
**Definition:** The reference to the subscription topic to be notified about.
**Cardinality:** 1..1
**Type:** [canonical](/canonical)
**Summary:** true
**Mappings:** w5=FiveWs.what[x]
## Subscription.contact
Contact details for source (e.g. troubleshooting)
**Definition:** Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.
**Cardinality:** 0..*
**Type:** [ContactPoint](/ContactPoint)
**Summary:** true
**Mappings:** w5=FiveWs.subject
## Subscription.end
When to automatically delete the subscription
**Definition:** The time for the server to turn the subscription off.
**Comments:** The server is permitted to deviate from this time but should observe it.
**Cardinality:** 0..1
**Type:** [instant](/instant)
**Summary:** true
**Mappings:** w5=FiveWs.done[x]
## Subscription.managingEntity
Entity responsible for Subscription changes
**Definition:** Entity with authorization to communicate with the server about this Subscription, such as requesting changes (e.g., updating an endpoint URL).
**Comments:** Note that the managing entity for a subscription does not need to be the client (e.g., in the case of server-managed Subscriptions).
**Cardinality:** 0..1
**Type:** Reference([CareTeam](/CareTeam), [Device](/Device), [Group](/Group), [HealthcareService](/HealthcareService), [Organization](/Organization), [RelatedPerson](/RelatedPerson), [Patient](/Patient), [Practitioner](/Practitioner), [PractitionerRole](/PractitionerRole))
**Summary:** true
**Mappings:** w5=FiveWs.author
## Subscription.reason
Description of why this subscription was created
**Definition:** A description of why this subscription is defined.
**Cardinality:** 0..1
**Type:** [string](/string)
**Summary:** true
**Mappings:** w5=FiveWs.why[x]
## Subscription.filterBy
Criteria for narrowing the subscription topic stream
**Definition:** The filter properties to be applied to narrow the subscription topic stream. When multiple filters are applied, evaluates to true if all the conditions applicable to that resource are met; otherwise it returns false (i.e., logical AND).
**Cardinality:** 0..*
**Type:** [BackboneElement](/BackboneElement)
**Summary:** true
**Constraints:** scr-1 | error | Subscription filters may only contain a modifier or a comparator | (comparator.exists() and modifier.exists()).not()
## Subscription.filterBy.resource
Allowed Resource (reference to definition) for this Subscription filter
**Definition:** A resource listed in the `SubscriptionTopic` this `Subscription` references (`SubscriptionTopic.canFilterBy.resource`). This element can be used to differentiate filters for topics that include more than one resource type.
**Cardinality:** 0..1
**Type:** [uri](/uri)
**Binding:** extensible:[subscription-types](/valueset-subscription-types)
**Summary:** true
## Subscription.filterBy.filterParameter
Filter label defined in SubscriptionTopic
**Definition:** The filter as defined in the `SubscriptionTopic.canFilterBy.filterParameter` element.
**Cardinality:** 1..1
**Type:** [string](/string)
**Summary:** true
## Subscription.filterBy.comparator
eq | ne | gt | lt | ge | le | sa | eb | ap
**Definition:** Comparator applied to this filter parameter.
**Comments:** Must be a comparator allowed by the SubscriptionTopic relevant to this Subscription filter.
**Conditions:** scr-1
**Cardinality:** 0..1
**Type:** [code](/code)
**Binding:** required:[search-comparator](/valueset-search-comparator)
## Subscription.filterBy.modifier
missing | exact | contains | not | text | in | not-in | below | above | type | identifier | of-type | code-text | text-advanced | iterate
**Definition:** Modifier applied to this filter parameter.
**Comments:** Must be a modifier allowed by the SubscriptionTopic relevant to this Subscription filter.
**Conditions:** scr-1
**Cardinality:** 0..1
**Type:** [code](/code)
**Binding:** required:[search-modifier-code](/valueset-search-modifier-code)
## Subscription.filterBy.value
Literal value or resource path
**Definition:** The literal value or resource path as is legal in search - for example, `Patient/123` or `le1950`.
**Cardinality:** 1..1
**Type:** [string](/string)
**Summary:** true
## Subscription.filterBy.event
Event to filter by
**Definition:** An event filter to be applied to the topic - e.g., if a topic defined multiple event triggers, this can be used to specify a single one. Multiple values are or-joined, multiple codings within a value are and-joined.
**Cardinality:** 0..*
**Type:** [CodeableConcept](/CodeableConcept)
**Binding:** example:[v2-0003](/valueset-v2-0003)
**Summary:** true
## Subscription.channelType
Channel type for notifications
**Definition:** The type of channel to send notifications on.
**Cardinality:** 1..1
**Type:** [Coding](/Coding)
**Binding:** extensible:[subscription-channel-type](/valueset-subscription-channel-type)
**Summary:** true
## Subscription.endpoint
URL where the channel sends notifications
**Definition:** Channel-specific URL that describes where notifications are sent.
**Comments:** The URL requirements are based on channel type. For example, in a `rest-hook` channel, the URL must use the `http` or `https` protocol and be supplied by the client; in a `websocket` channel, the URL uses the `ws` or `wss` protocol and is supplied by the server.
Note that the URI is allowed to be relative. Relative URLs are relative to the FHIR server base URL (since there may be more than one, clients should avoid using relative URIs).
**Cardinality:** 0..1
**Type:** [url](/url)
**Summary:** true
## Subscription.parameter
Channel type dependent information
**Definition:** Channel-dependent information to send as part of the notification (e.g., HTTP Headers).
**Comments:** Exactly what these mean depends on the channel type. They can convey additional information to the server or recipient and/or meet security requirements; for example, support of multiple headers in the outgoing notifications for rest-hook type subscriptions. Note that names are not required to be unique, but channel definitions can impose restrictions.
**Cardinality:** 0..*
**Type:** [BackboneElement](/BackboneElement)
## Subscription.parameter.name
Name (key) of the parameter
**Definition:** Parameter name for information passed to the channel for notifications, for example in the case of a REST hook wanting to pass through an authorization header, the name would be Authorization.
**Cardinality:** 1..1
**Type:** [string](/string)
## Subscription.parameter.value
Value of the parameter to use or pass through
**Definition:** Parameter value for information passed to the channel for notifications, for example in the case of a REST hook wanting to pass through an authorization header, the value would be `Bearer 0193...`.
**Cardinality:** 1..1
**Type:** [string](/string)
## Subscription.heartbeatPeriod
Interval in seconds to send 'heartbeat' notification
**Definition:** If present, a 'heartbeat' notification (keep-alive) is sent via this channel with an interval period equal to this elements integer value in seconds. If not present, a heartbeat notification is not sent.
**Cardinality:** 0..1
**Type:** [unsignedInt](/unsignedInt)
**Summary:** true
## Subscription.timeout
Timeout in seconds to attempt notification delivery
**Definition:** If present, the maximum amount of time a server will allow before failing a notification attempt.
**Cardinality:** 0..1
**Type:** [unsignedInt](/unsignedInt)
**Summary:** true
## Subscription.contentType
MIME type to send, or omit for no payload
**Definition:** The MIME type to send the payload in - e.g., `application/fhir+xml` or `application/fhir+json`. Note that:
* clients may request notifications in a specific FHIR version by using the [FHIR Version Parameter](http.html#version-parameter) - e.g., `application/fhir+json; fhirVersion=4.0`.
* additional MIME types can be allowed by channels - e.g., `text/plain` and `text/html` are defined by the Email channel.
**Cardinality:** 0..1
**Type:** [code](/code)
**Binding:** required:[mimetypes](/valueset-mimetypes)
**Summary:** true
## Subscription.content
empty | id-only | full-resource
**Definition:** How much resource content to deliver in the notification payloads. The choices are an empty payload, only the resource id, or the full resource content.
**Comments:** Sending the payload has obvious security implications. The server is responsible for ensuring that the content is appropriately secured. For additional information, see [Notification Content](subscription.html#payloads).
**Cardinality:** 0..1
**Type:** [code](/code)
**Binding:** required:[subscription-payload-content](/valueset-subscription-payload-content)
**Summary:** true
## Subscription.maxCount
Maximum number of events that can be combined in a single notification
**Definition:** If present, the maximum number of events that will be included in a notification bundle. Note that this is not a strict limit on the number of entries in a bundle, as dependent resources can be included.
**Cardinality:** 0..1
**Type:** [positiveInt](/positiveInt)
**Summary:** true