Create/update subscription filter

post/v0/subscriptions/{subscriptionId}/filters
Page View

Filters endpoints allow you to review or manage filters. You can define a filter with multiple rules for asynchronous messages. You may have one filter defined per subscription. Learn about filters.

You can retrieve, create, update, or delete filters.

Create/update subscription filter

Create a new filter or update an existing filter for a given subscription.

A new filter is created if you don't include a filter ID.

To update a filter, include the filter's existing ID in your request. Otherwise, a new filter will be created.

If you choose to create or update a filter for fields with confidential data like PHI, users with lower permissions may have viewing access. Filter and log payload access are managed by different permissions. Please assign user roles based on your security policies.

Request parameters and payload

cURL request example

bash
1
curl 'https://api.redoxengine.com/platform/v0/subscriptions/{subscriptionId}/filters' \
2
--request POST \
3
--header 'Authorization: Bearer $API_TOKEN' \
4
--header 'accept: application/json' \
5
--header 'content-type: application/json' \
6
--data '{
7
"filter": {
8
"id": "09a85196-2760-4296-b874-59d0cdbb7bc4",
9
"name": "Filter name",
10
"environmentId": "fd1d07e0-1fd2-410f-b57e-e51ac208e7e9",
11
"action": "send",
12
"rules": [
13
{
14
"path": "$.Patient.Demographics.FirstName",
15
"values": [
16
"string"
17
],
18
"allowList": true
19
}
20
]
21
}
22
}'

Request Body Schema

  • filter
    required, object
    • name
      required, string

      Contains a human-readable name for the filter.

    • environmentId
      required, string

      Identifies the specific environment that you're operating in or on behalf of.

    • action
      required, string

      Defines what action should be performed when the filter is applied to an asynchronous message.

      Possible Values: send, block-all
    • rules
      required, Array of object

      Contains a list of rules that determine when the filter is applied to a message. A filter is only applied if ALL rules are met.

      • path
        string

        Specifies the path to the field(s) that should be evaluated when the filter is applied. This should be a jsonpath value.

      • values
        Array of string

        Contains an array of string values that are matched against the path value when the rule is evaluated.

      • allowList
        boolean

        Indicates whether the rule is an allow-list (matches when the value at the specified path is in the values array) or a deny-list (matches when the value at the specified path is NOT in the values array). Defaults to true (allow-list).

    • id
      string

      Contains the ID of the filter to be updated. If not present, a new filter is created instead.

Response fields and example

Example payload generated from schema
1
{
2
"payload": {
3
"filter": {
4
"id": "09a85196-2760-4296-b874-59d0cdbb7bc4",
5
"filterVersion": 1,
6
"createdAt": "2021-03-08T18:10:37.555Z",
7
"updatedAt": "2021-03-08T18:17:16.719Z",
8
"version": "1.0.0",
9
"name": "Filter name",
10
"organizationId": 122,
11
"environmentId": "fd1d07e0-1fd2-410f-b57e-e51ac208e7e9",
12
"action": "send",
13
"creatingUserId": 3363,
14
"lastUpdatingUserId": 3363,
15
"deletedAt": "2021-03-08T18:17:16.719Z",
16
"deletingUserId": 3363,
17
"rules": [
18
{
19
"path": "$.Patient.Demographics.FirstName",
20
"values": [
21
"string"
22
],
23
"allowList": true
24
}
25
],
26
"filterLinks": [
27
{
28
"id": "b65f7210-1c60-40fd-975e-1baaf5011277",
29
"createdAt": "2021-03-08T18:10:37.571Z",
30
"updatedAt": "2021-03-08T18:10:37.571Z",
31
"version": "1.0.0",
32
"organizationId": 123,
33
"creatingUserId": 3363,
34
"lastUpdatingUserId": 3363,
35
"dataModel": "PatientAdmin",
36
"eventType": "NewPatient",
37
"deletedAt": "2021-03-08T18:10:37.571Z",
38
"deletingUserId": 3363,
39
"destinationId": "74827916-39fa-4b76-bcf8-969aad3fca88",
40
"sourceId": "98d3cc95-66d8-4d46-b05c-77dcf231aa4b",
41
"filterSettingsId": "09a85196-2760-4296-b874-59d0cdbb7bc4"
42
}
43
],
44
"pathType": "jsonpath"
45
}
46
}
47
}
  • payload
    object
    • filter
      object

      Contains an instance of a subscription filter.

      • id
        string

        Displays the unique ID of the filter.

        Format: uuid
      • filterVersion
        integer

        Displays the numeric version of the filter. A new filter version is created whenever the filter is modified.

      • createdAt
        string

        Displays a timestamp of when the filter was initially created.

      • updatedAt
        string

        Displays a timestamp of when the filter was last updated.

      • version
        string

        Displays the API schema version used for this filter instance.

      • name
        string

        Displays the filter's human-readable name.

      • organizationId
        integer

        Identifies the Redox organization that the filter belongs to.

      • environmentId
        string

        Identifies the environment that the filter belongs to.

      • action
        string

        Indicates the action to be performed when the filter rules are met.

        Possible Values: send, block-all
      • creatingUserId
        integer

        Displays the unique ID of the user that created the filter.

      • lastUpdatingUserId
        integer

        Displays the unique ID of the user that most recently updated the filter.

      • deletedAt
        string

        Displays a timestamp of when the filter was deleted. If the filter hasn't been deleted, this field is populated with a null value.

      • deletingUserId
        integer

        Displays the unique ID of the user that deleted the filter. If the filter hasn't been deleted, this field is populated with a null value.

      • rules
        Array of object

        Contains a list of rules that determine when the filter is applied to a message. A filter is only applied if ALL rules are met.

        • path
          string

          Specifies the path to the field(s) that should be evaluated when the filter is applied. This should be a jsonpath value.

        • values
          Array of string

          Contains an array of string values that are matched against the path value when the rule is evaluated.

        • allowList
          boolean

          Indicates whether the rule is an allow-list (matches when the value at the specified path is in the values array) or a deny-list (matches when the value at the specified path is NOT in the values array). Defaults to true (allow-list).

      • Contains an array of filter links, which indicate which connection(s), data models, and event types the filter is used for. Usually filters are only used in one place, so this array will usually have just one entry.

        • id
          string

          Displays the unique ID of this filter link.

          Format: uuid
        • createdAt
          string

          Displays a timestamp of when the filter link was initially created.

        • updatedAt
          string

          Displays a timestamp of when the filter link was last updated.

        • version
          string

          Displays the API schema version used for this filter link.

        • organizationId
          integer

          Identifies the Redox organization that the filter link belongs to.

        • creatingUserId
          integer

          Displays the unique ID of the user that initially created the filter link.

        • lastUpdatingUserId
          integer

          Displays the unique ID of the user that last updated the filter link.

        • dataModel
          string

          Displays the data model that the filter link is applied to.

        • eventType
          string

          Displays the specific event type that the filter link is applied to, if any.

        • deletedAt
          string

          Displays a timestamp of when the filter link was deleted. If the filter link hasn't been deleted, this field is populated with a null value.

        • deletingUserId
          integer

          Displays the unique ID of the user that deleted the filter link. If the filter link hasn't been deleted, this field is populated with a null value.

        • destinationId
          string

          Displays the unique ID of the destination that the filter link is applied to.

          Format: uuid
        • sourceId
          string

          Displays the unique ID of the source that the filter link is applied to.

          Format: uuid
        • filterSettingsId
          string

          Displays the unique ID of the filter that is being applied by the filter link.

          Format: uuid
      • pathType
        string

        Specifies the format of the field paths defined for this filter's rules. Both FHIR and data model filters use the jsonpath path type.

        Value: jsonpath