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

# Manage SDK Push Notifications APIs

<Badge icon="arrow-left" color="gray">[Back to API List](/ai-for-service/apis/automation/api-list)</Badge>

The platform provides the following APIs for managing SDK push notifications:

* [Device Subscription](#device-subscription-api) API
* [Subscribed User Devices](#subscribed-user-devices-api) API
* [Device Unsubscription](#device-unsubscription-api) API

<Note>
  To receive push notifications, each user's device must be registered and subscribed via the mobile or WebSDK app.
</Note>

## Device Subscription API

This API manages SDK push message subscriptions for a user's specified device. It:

* Subscribes the device to SDK push messages.
* Returns subscription status and device details.

| **Field**         | **Value**                                                                                                                          |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **Method**        | POST                                                                                                                               |
| **Endpoint**      | `https://{host}/API/public/streams/:{{streamId}}/sdknotifications/subscribe`                                                       |
| **Content Type**  | `application/json`                                                                                                                 |
| **Authorization** | `auth: {{JWT}}` — See [How to generate the JWT Token](/ai-for-service/apis/automation/api-introduction/#generating-the-jwt-token). |
| **API Scope**     | App Builder: SDKPushNotifications; Admin Console: Not Applicable                                                                   |

### Path Parameters

| **Parameter** | **Description**                                                                | **Required/Optional** |
| ------------- | ------------------------------------------------------------------------------ | --------------------- |
| `host`        | The environment URL. For example, `https://platform.kore.ai`                   | Required              |
| `StreamId`    | Bot ID or Stream ID. Accessible under **General Settings** on the App Builder. | Required              |

### Sample Request

```js theme={null}
curl --location
'https://{{host}}/api/public/stream/:{{streamId}}/sdknotifications/subscribe' \
     --header 'auth: {jwt-token}' \
     --header 'bot-language: {language-code}' \
     --header 'Content-Type: application/json' \
--data-raw '{
    "deviceId": "exxxxxf0-bxx3-4xx3-axx7-fexxxxxxxxxx2",
    "osType": "Android",
    "userId": "u-dxxxxxx1-7xx0-5xxb-axx2-84xxxxxxxxx2"
}'
```

### Body Parameters

| **Parameter** | **Data Type** | **Description**                          | **Required/Optional** |
| ------------- | ------------- | ---------------------------------------- | --------------------- |
| `deviceId`    | String        | The user's device ID.                    | Required              |
| `osType`      | String        | The OS type of the user's device.        | Required              |
| `userId`      | String        | The user ID received from the JWT grant. | Required              |

### Sample Response

```js theme={null}
{
    "success": true,
    "message": "Device Subscribed",
    "deviceDetails": {
        "deviceId": "exxxxxf0-bxx3-4xx3-axx7-fexxxxxxxxxx2",
        "osType": "Android",
        "status": "Subscribed"
    }
}
```

## Subscribed User Devices API

This API lists all mobile devices subscribed to SDK push notifications for a given user, including device ID, OS type, and subscription status.

| **Field**         | **Value**                                                                                                                          |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **Method**        | GET                                                                                                                                |
| **Endpoint**      | `https://{host}/API/public/streams/:{{streamId}}/subscribeddevices`                                                                |
| **Content Type**  | `application/json`                                                                                                                 |
| **Authorization** | `auth: {{JWT}}` — See [How to generate the JWT Token](/ai-for-service/apis/automation/api-introduction/#generating-the-jwt-token). |
| **API Scope**     | App Builder: SDKPushNotifications; Admin Console: Not Applicable                                                                   |

### Query Parameters

| **Parameter** | **Description**                                                                | **Required/Optional** |
| ------------- | ------------------------------------------------------------------------------ | --------------------- |
| `host`        | The environment URL. For example, `https://platform.kore.ai`                   | Required              |
| `StreamId`    | Bot ID or Stream ID. Accessible under **General Settings** on the App Builder. | Required              |
| `UserId`      | The user ID received from the JWT grant.                                       | Required              |

### Sample Request

```js theme={null}
curl --location
'https://{{host}}/api/public/streams/:{{streamId}}/subscribeddevices?uId=-f30xxx4e-6xx3-5xx8-8xx7-01xxxxxxxxx4u' \
     --header 'auth: {jwt-token}' \
     --header 'bot-language: {language-code}' \
     --header 'Content-Type: application/json' \
--data-raw '{
}'
```

### Body Parameters

No body parameters.

### Sample Response

```js theme={null}
{
    "subscribedDevices": [
        {
            "deviceId": "exxxxxf0-bxx3-4xx3-axx7-fexxxxxxxxxx2",
            "osType": "Android",
            "status": "Subscribed"
        },
        {
            "deviceId": "exxxxxx0-bxx3-4xx3-axx7-fxxxxxxxxxxf",
            "osType": "ios",
            "status": "Subscribed"
        }
    ]
}
```

## Device Unsubscription API

This API unsubscribes SDK push messages for specific or all devices of a user.

**Note:** The API processes unsubscriptions for one user at a time, not for multiple users simultaneously.

| **Field**         | **Value**                                                                                                                          |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **Method**        | DELETE                                                                                                                             |
| **Endpoint**      | `https://{host}/API/public/streams/:{{streamId}}/sdknotifications/unsubscribe`                                                     |
| **Content Type**  | `application/json`                                                                                                                 |
| **Authorization** | `auth: {{JWT}}` — See [How to generate the JWT Token](/ai-for-service/apis/automation/api-introduction/#generating-the-jwt-token). |
| **API Scope**     | App Builder: SDKPushNotifications; Admin Console: Not Applicable                                                                   |

### Path Parameters

| **Parameter** | **Description**                                                                | **Required/Optional** |
| ------------- | ------------------------------------------------------------------------------ | --------------------- |
| `host`        | The environment URL. For example, `https://platform.kore.ai`                   | Required              |
| `StreamId`    | Bot ID or Stream ID. Accessible under **General Settings** on the App Builder. | Required              |

### Unsubscribe Specific Devices

Returns the device ID, OS type, and subscription status (unsubscribed) for the selected devices.

#### Sample Request

```js theme={null}
curl --location
'https://{{host}}/api/public/streams/:{{streamId}}/sdknotifications/unsubscribe' \
     --header 'auth: {jwt-token}' \
     --header 'bot-language: {language-code}' \
     --header 'Content-Type: application/json' \
--data-raw '{
  "devices":
              [
    { "deviceId": "exxxxxx0-bxx3-4xx3-axx7-fxxxxxxxxxxf", "osType": "iOS" },
               { "deviceId": "exxxxxx1-bxx5-5xx3-axx2-bxxxxxxxxxxf", "osType": "Android" }
              ],
    		  "userId": "u-fxxxxxxe-6xx3-5xx8-8xx7-0xxxxxxxxxx4"
}'
```

#### Body Parameters

| **Parameter**                                 | **Data Type**             | **Description**                                                     | **Required/Optional** |
| --------------------------------------------- | ------------------------- | ------------------------------------------------------------------- | --------------------- |
| `devices` (if not using `unsubscribe: 'all'`) | Array of objects (String) | Provide the **device ID** and **osType** of devices to unsubscribe. | Required              |
| `userId`                                      | String                    | The user ID received from the JWT grant.                            | Required              |

#### Sample Response

```js theme={null}
{
    "success": true,
    "message": "Requested devices are Unsubscribed",
    "unsubscribedDevices": [
        {
            "deviceId": "exxxxxx0-bxx3-4xx3-axx7-fxxxxxxxxxxf",
            "osType": "iOS",
            "status": "unsubscribed"
        },
        {
            "deviceId": "exxxxxx1-bxx5-5xx3-axx2-bxxxxxxxxxxf",
            "osType": "Android",
            "status": "unsubscribed"
        }
    ],
    "invalidDeviceIds": [
        {
            "deviceId": "Prod Iphone5rs"
        }
    ]
}
```

### Unsubscribe All Devices

Returns the success status and message when all devices are unsubscribed.

#### Sample Request

```js theme={null}
curl --location
'https://{{host}}/api/public/streams/:{{streamId}}/sdknotifications/unsubscribe' \
     --header 'auth: {jwt-token}' \
     --header 'bot-language: {language-code}' \
     --header 'Content-Type: application/json' \
--data-raw '{
    "unsubscribe": "all",
    "userId": "u-fxxxxxxe-6b83-56d8-8397-011c430550a4"
}'
```

#### Body Parameters

| **Parameter**                             | **Data Type** | **Description**                            | **Required/Optional** |
| ----------------------------------------- | ------------- | ------------------------------------------ | --------------------- |
| `unsubscribe` (if not using `devices:[]`) | String        | Set to `"all"` to unsubscribe all devices. | Required              |
| `userId`                                  | String        | The user ID received from the JWT grant.   | Required              |

#### Sample Response

```js theme={null}
{
    "success": true,
    "message": "All Devices are unsubscribed"
}
```
