--- title: "Using LUSID filtering syntax to subscribe to events conditionally" slug: "using-lusid-filtering-syntax-to-subscribe-to-events-conditionally" tags: ["notification service ", "filter"] updated: 2025-04-16T14:18:49Z published: 2025-04-16T14:18:49Z canonical: "support.lusid.com/using-lusid-filtering-syntax-to-subscribe-to-events-conditionally" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.lusid.com/llms.txt > Use this file to discover all available pages before exploring further. # Using LUSID filtering syntax to subscribe to events conditionally You can use LUSID's [filtering syntax](/v1/docs/filtering-information-retrieved-from-lusid) to subscribe to an event conditionally; that is, to only trigger notifications when those conditions are met. You can filter on any of the [attributes](/v1/docs/what-system-events-can-i-subscribe-to) of an event. For example, when you call the [ListEventTypes](https://www.lusid.com/docs/api/notification/endpoints/event-types/ListEventTypes) API to examine the `PortfolioCreated` event, you see it has seven common string attributes in the `headerSchema` and two specific string attributes in the `bodySchema`: ```json {  "values": [    {      "id": "PortfolioCreated",      "displayName": "Portfolio Created",      "description": "An event of this type is fired whenever a PortfolioCreated event is created in LUSID",      "application": "Lusid",      "headerSchema": [        {          "name": "eventType",          "type": "String"        },        {          "name": "requestId",          "type": "String"        },        {          "name": "userId",          "type": "String"        },        {          "name": "action",          "type": "String"        },        {          "name": "entityType",          "type": "String"        },        {          "name": "timestamp",          "type": "String"        },        {          "name": "href",          "type": "String"        }      ],      "bodySchema": [        {          "name": "portfolioScope",          "type": "String"        },        {          "name": "portfolioCode",          "type": "String"        }      ]      "href": "https://.lusid.com/notification/api/eventtypes/PortfolioCreated"    },    ...  ], } ``` You apply your filter in the `filter` field when you [create a subscription](/v1/docs/how-do-i-subscribe-to-an-event) to that event. Note you must prefix attributes appropriately with either `Header.` or `Body.`. For example, you could subscribe to the `PortfolioCreated` event only when a portfolio is created in a particular scope, and by a particular user: ```json "matchingPattern": {    "eventType": "PortfolioCreated",    "filter": "Header.userId eq '00uji4twb4jDcHGjN2p8' and Body.portfolioScope eq 'Finbourne-Examples'" } ``` Applying the above filter using the LUSID web app might look as follows: ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image(740).png?sv=2026-02-06&spr=https&st=2026-11-09T06%3A14%3A35Z&se=2026-11-09T07%3A14%3A35Z&sr=c&sp=r&sig=Cq1tWQJsObBbjSntG30A5HNTIbqo9aIPX%2BcCm%2FTCgZc%3D)