> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metriport.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Subscription

> The subscription resource is used to define a push-based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined channel so that another system can take an appropriate action.

## Properties

| Name | Required | Type | Description |
| - | - | - | - |
| status | Yes | code | requested / active / error / off |
| contact | No | [ContactPoint](https://docs.metriport.com/medical-api/fhir/data-types/contactpoint.md)\[] | Contact details for source (e.g. troubleshooting) |
| end | No | instant | When to automatically delete the subscription |
| reason | Yes | string | Description of why this subscription was created |
| criteria | Yes | string | Rule for server push |
| error | No | string | Latest error note |
| channel | Yes | SubscriptionChannel | The channel on which to report matches to the criteria |
| - id | No | string | Unique id for inter-element referencing |
| - extension | No | [Extension](https://docs.metriport.com/medical-api/fhir/data-types/extension)\[] | Additional content defined by implementations |
| - modifierExtension | No | [Extension](https://docs.metriport.com/medical-api/fhir/data-types/extension)\[] | Extensions that cannot be ignored even if unrecognized |
| - type | Yes | code | rest-hook / websocket / email / sms / message |
| - endpoint | No | url | Where the channel points to |
| - payload | No | code | MIME type to send, or omit for no payload |
| - header | No | string\[] | Usage depends on the channel type |

## Search Parameters

| Name | Type | Description | Expression |
| - | - | - | - |
| contact | token | Contact details for the subscription | Subscription.contact |
| criteria | string | The search rules used to determine when to send a notification | Subscription.criteria |
| payload | token | The mime-type of the notification payload | Subscription.channel.payload |
| status | token | The current state of the subscription | Subscription.status |
| type | token | The type of channel for the sent notifications | Subscription.channel.type |
| url | uri | The uri that will receive the notifications | Subscription.channel.endpoint |

## Inherited Properties

| Name | Required | Type | Description |
| - | - | - | - |
| id | No | string | Logical id of this artifact |
| meta | No | [Meta](https://docs.metriport.com/medical-api/fhir/data-types/meta.md) | Metadata about the resource |
| implicitRules | No | uri | A set of rules under which this content was created |
| language | No | code | Language of the resource content |
| text | No | [Narrative](https://docs.metriport.com/medical-api/fhir/data-types/narrative.md) | Text summary of the resource, for human interpretation |
| contained | No | Resource\[] | Contained, inline Resources |
| extension | No | [Extension](https://docs.metriport.com/medical-api/fhir/data-types/extension)\[] | Additional content defined by implementations |
| modifierExtension | No | [Extension](https://docs.metriport.com/medical-api/fhir/data-types/extension)\[] | Extensions that cannot be ignored |

To view the FHIR specification for this resource, see [Subscription](https://www.hl7.org/fhir/StructureDefinition/Subscription).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.