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

# Proactive Notifications API

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

Proactive Notifications allow enterprises to engage with end users (customers or employees) with relevant and timely updates.

Use cases include:

* Nudge employees to reset their password before it expires.
* Remind users to submit expense reports.
* Inform customers about their order status.
* Send other defined reminders.

| **Field**         | **Value**                                                                                                                          |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **Method**        | POST                                                                                                                               |
| **Endpoint**      | `https://{{host}}/api/public/bot/{{BotID}}/notify`                                                                                 |
| **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: Proactive Messages; Admin Console: Channel Management > Proactive Messages                                            |

## Path Parameters

| **Parameter** | **Required/Optional** | **Description**                                                                                                                                         |
| ------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `host`        | Required              | The environment URL. For example, `https://platform.kore.ai`                                                                                            |
| `BotId`       | Required              | Bot ID or Stream ID. Accessible under **General Settings** on the App Builder. **Note:** Required only for App Builder API scope of Proactive Messages. |

## Sample Request

```json theme={null}
curl --location 'https://{{host}}/api/public/bot/{{BotId}}/notify' \
--header 'Content-Type: application/json' \
--header 'auth: {{jwt-token}}' \
--data-raw '{
"channel": "msteams",
"userIdentityType": "resolve",
"message": {
"type": "text",
"val": "Please reset your password."
},
"identities": [
"john.doe@example.com"
]
}'
```

## Body Parameters

| **Parameter**      | **Required/Optional** | **Description**                                                                                                                          |
| ------------------ | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `channel`          | Required              | Name of the channel for notifications. Accepted values: `"msteams"` and `"slack"`.                                                       |
| `userIdentityType` | Required              | Defines whether to resolve user identities to channel identities or use them directly. Value: `resolve`.                                 |
| `message`          | Required              | Object with two fields: `type` (message type: `"text"` for plain text, `"script"` for JavaScript templates) and `val` (message content). |
| `identities`       | Required              | List of user identities to notify. Maximum of 1000 identities supported.                                                                 |

**Example — Text message:**

```json theme={null}
{
  "type": "text",
  "val": "Hi User"
}
```

**Example — Script message:**

```json theme={null}
{
   "type": "script",
   "val": "var envMsg = 'John'; var channel = context.session.BotUserSession.lastMessage.channel; print(JSON.stringify({text: 'Hi ' + envMsg + ' message is from ' + channel + ' channel'}));"
}
```

## Sample Response

```json theme={null}
{
    "status": "IN_PROGRESS",
    "percentageComplete": 0,
    "streamId": "st-xxxxx-xxx-xxx-xxx-xxxxx",
    "createdBy": "u-xxxxx-xxx-xxx-xxx-xxxxx",
    "jobType": "PROACTIVE_NOTIFICATIONS_API",
    "action": "PROACTIVE_NOTIFICATIONS",
    "statusLogs": [],
    "_id": "ds-xxxxx-xxx-xxx-xxx-xxxxx",
    "lMod": "2022-01-25T06:56:48.000Z",
    "createdOn": "2022-01-25T06:56:48.891Z",
    "requestedTime": "2022-01-25T06:56:48.891Z",
    "__v": 0
}
```
