---
title: "Subscribe to Notification"
method: POST
path: "/NotificationSubscriptions"
tags: ["NotificationSubscriptions"]
---

# Subscribe to Notification

`POST /NotificationSubscriptions`

## Request

- Base URL: `https://sb2api.servicechannel.com/v3`
- URL: `https://sb2api.servicechannel.com/v3/NotificationSubscriptions`
- Auth: OAuth 2
  - Authorization code: `https://sb2login.servicechannel.com/oauth/authorize`
  - Token URL: `https://sb2login.servicechannel.com/oauth/token`
- TypeScript: <https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/docs/NotificationSubscriptions/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new Subscription. Returns a unique subscription ID for a successful request.
            See [Event Objects](/guides/wh/event-objects/) for example notification objects and descriptions of their fields.
            <br />**Example Request**
            
                POST /NotificationSubscriptions/Subscribe
                {
                  "Name": "New Subscription",
                  "IsEnabled": true,
                  "Type": "MSBot",
                  "Content": 
                  {
                    "ConversationId":"a:1aV4BNOWtTdqJhkdgsdfhsdfhsgjdfgjdrtydjyj",
                    "TenantId":"1111111-1111-1111-1111-111111111111",
                    "UserId":"29:1oTNViX5ByDxfsgdfgsdhgjlnkkli",
                    "UserName":"First Last",
                    "ServiceUrl":"https://smba.trafficmanager.net/amer/"
                  }
                }

## Request body

- ServiceChannelServicesMessagingNotificationsNotificationSubscriptionRequest: NotificationSubscriptionRequest
  - `Name` string: The user-friendly name for the subscription.
  - `IsEnabled` boolean: Defines if the subscription is active or inactive.
  - `Type` 'MSTeams', required: Notification Subscription Type
  - `Content` SystemObject, required

## Response `201`

The subscription is created.

- ServiceChannelServicesMessagingNotificationsAddNotificationSubsciptionResponse
  - `Id` integer: The unique subscription ID. Generated automatically and cannot be modified.

## Other responses

- `400`: The request is not accepted due to bad syntax, missing parameters, insufficient data, etc. <br/>Error codes: 2105 - Operation is not allowed. 503 - Required data missing or incorrect
- `401`: The request is not authorized. <br/>Error codes: 504 - Missing or incorrect authentication credentials

---

[API](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3.md) - [All operations](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/llms.txt) - [OpenAPI document](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/revisions/d490d6596809?raw)
