---
title: "Migrating to version 2 of the Notification Service"
slug: "migrating-to-version-2-of-the-notification-service"
updated: 2024-09-23T16:05:07Z
published: 2024-09-23T16:05:07Z
canonical: "support.lusid.com/migrating-to-version-2-of-the-notification-service"
---

> ## 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.

# Migrating to version 2 of the Notification Service

As we make changes in the source code and issue new releases, you may need to update to the latest version of the Notification Service. This page shows you what updates are included and how to migrate to the newest version.

In version 2:

- The Notification Service moves to `https://&lt;your-domain&gt;.lusid.com/notification/api/`. **Users need to update their code to reflect this change.**
  - Version 2 of the Notification Service Python SDK can be found [here](https://github.com/finbourne/notifications-sdk-python-preview/tree/v2).
  - Version 2 of the Notification Service C# SDK can be found [here](https://github.com/finbourne/notifications-sdk-csharp-preview/tree/v2).
  - Version 2 of the API reference can be found [here](https://www.lusid.com/docs/api/notification/intro).
- Users can now subscribe to an expanded set of events, including order creation events, allocation events and more. [See how to list all events](/v1/docs/what-system-events-can-i-subscribe-to).
  - `TransactionPortfolioCreated` has been replaced by `PortfolioCreated` using a different schema. **Users need to update their code to reflect this change.**
- Users can now send an AWS Simple Queue Service (SQS) notification when an event occurs. [Read more on this.](/v1/docs/how-do-i-send-an-amazon-simple-queue-service-sqs-notification-when-an-event-occurs)
- Some APIs have changed and/or been renamed. **Users need to update their code to reflect the following changes:**
  - [TriggerManualEvent](https://www.lusid.com/docs/api/notification/endpoints/manual-event/TriggerManualEvent) has replaced the `CreateEvent` API. [See how to use the updated Manual event.](/v1/docs/using-the-manual-event-to-notify-people-when-non-lusid-activity-occurs)
  - `Notifications` APIs, including `CreateEmailNotification`, `CreateSmsNotification`, `CreateWebhookNotification`, `UpdateEmailNotification`, `UpdateSmsNotification` and `UpdateWebhookNotification` have been consolidated into [CreateNotification](https://www.lusid.com/docs/api/notification/endpoints/notifications/CreateNotification) and [UpdateNotfication](https://www.lusid.com/docs/api/notification/endpoints/notifications/UpdateNotification). Users now need to specify the notification type within the body of the call:
    - [See how to create an email notification.](/v1/docs/how-do-i-notify-people-via-email-when-an-event-occurs)
    - [See how to create an SMS notification.](/v1/docs/how-do-i-notify-people-via-sms-when-an-event-occurs)
    - [See how to create a webhook notification.](/v1/docs/how-do-i-create-a-webhook-to-call-a-lusid-api-when-an-event-occurs)
    - [See how to create an AWS SQS notification.](/v1/docs/how-do-i-send-an-amazon-simple-queue-service-sqs-notification-when-an-event-occurs)
  - Event attributes have been updated to include a `headerSchema` and `bodySchema`. Users need to update their code to prefix these attributes with `Header.` or `Body.` when using them in mustache templates and LUSID filtering syntax.

For example, you can update mustache templates in your notifications by calling the [UpdateNotification](https://www.lusid.com/docs/api/notification/endpoints/notifications/UpdateNotification) API and passing in the subscription `scope` and `code`, the notification `id` and the request body for the type of notification you're updating. An updated email notification for the portfolio created event might look like this:

```json
curl -X 'PUT' \
  'https://<your-domain>.lusid.com/notification/api/subscriptions/PortfolioCreated/PortfolioCreatedEvent/notifications/EmailNotification' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json-patch+json' \
  -H 'Authorization: Bearer <your-bearer-token>' \
  -d '{
  "displayName": "PortfolioCreatedEventEmailNotification",
  "description": "An email notification for portfolio created events",
  "notificationType": {
    "Type": "Email",
    "Subject": "Portfolio with scope {{Body.PortfolioScope}} and code {{Body.PortfolioCode}} created",
    "PlainTextBody": "Portfolio with scope {{Body.PortfolioScope}} and code {{Body.PortfolioCode}} created at {{Header.timestamp}}",
    "HtmlBody": "<p>Portfolio with scope {{Body.PortfolioScope}} and code {{Body.PortfolioCode}} created at {{Header.timestamp}}</p>",
    "EmailAddressTo": [
      "joe.bloggs@acme.com"
    ]
  }
}'
```
    - [See how to use LUSID filtering syntax to subscribe to events conditionally.](/v1/docs/using-lusid-filtering-syntax-to-subscribe-to-events-conditionally)
    - [See how to use mustache templates to enrich notification messages.](/v1/docs/using-mustache-templates-to-enrich-notifications)
- Users can now interact with version 2 of the Notification Service in Luminesce using the following providers:

**Please note:**
  - [Notification.Subscription](/v1/docs/notificationsubscription)
  - [Notification.Subscription.NotificationConfiguration](/v1/docs/notificationsubscriptionnotificationconfiguration)
  - [Notification.ManualEvent.Writer](/v1/docs/notificationmanualeventwriter)
  - [Notification.EventType](/v1/docs/notificationeventtype)
  - [Notification.Delivery](/v1/docs/notificationdelivery)
  - `Notification.Subscription`, `Notification.EventType` and `Notification.Delivery` return both version 1 and 2 data.
  - The version 1 Luminesce providers `Notification.Event.Writer` and `Notification.Subscription.Notification` are now deprecated but, for now, can still be used to interact with version 1 of the Notification Service. We advise users migrate to version 2 as soon as they can.
