# Webhooks - New functionalities

### Alerts Menu Item

Webhooks is moved out from Setup to Alerts Menu Item on VMS web. The Alerts menu group has several menu items

* Webhooks - shows the list of subscriptions made by the user if the user is a non-administrative role and shows all the subscriptions in the system for an administrator user
* Notifications - shows the list of Notifications for all the subscriptions visible for the user.

#### Webhooks&#x20;

Clicking one of the rows in webhooks, opens the webhook subscription drawer with the tabs; Overview, Notifications, Comments and attachments.  While Overview has some new additions to it, Comments remain the same from before.

<figure><img src="https://content.gitbook.com/content/NLqipxtUnsXueZRXkMI6/blobs/FzZw4g0jM6SzEkw2iVJL/image.png" alt=""><figcaption></figcaption></figure>

* Notifications tab in the subscription drawer includes the list of notifications filtered for the selected subscription. From 6.10.0, this list is updated to be similar to the other lists on VMS web with enabled filters and sorting.

<figure><img src="https://content.gitbook.com/content/NLqipxtUnsXueZRXkMI6/blobs/VkJs7AsJ9t0BTpKtLlyd/Screenshot%202025-01-21%20at%2012.38.22.png" alt=""><figcaption></figcaption></figure>

* Further clicking on one of the rows in the notifications list on subscription drawer, we can see the details of the Notification Msg sent for the subscription along with the error msg if the msg sending failed.

<figure><img src="https://content.gitbook.com/content/NLqipxtUnsXueZRXkMI6/blobs/eUgqqHllEHWANME3GHZu/ws5.png" alt=""><figcaption></figcaption></figure>

## New functionality

{% tabs %}
{% tab title="Prevent Unsubscription" %}
A new attribute, called **doNotUnsubscribe** (**Prevent Unsubscription**)**,** has been added to prevent that the subscription will get unsubscribed by the system. Also if the endpoint is not reachable for more times than the max number of attempts set for the given server.&#x20;

<figure><img src="https://content.gitbook.com/content/NLqipxtUnsXueZRXkMI6/blobs/nbedCfWOUv9Ks87BdTgA/image.png" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Template Message" %}
Introduced the possibility for users to define a message template that should be used when sending notifications for a webhook subscription.

When creating a Webhook Subscription, provide a text string for the attribute **templateMsg**. Attributes from the updated object can be included in the notification text through the format `{{attributeName}}.`

For example, when creating a subscription on Bank object , the user can use a templateMsg like *‘Bank with Name {{bankName}} is changed by {{changedById}} .*

<figure><img src="https://content.gitbook.com/content/NLqipxtUnsXueZRXkMI6/blobs/RK0Vlap9Nnj7AzXvx340/image.png" alt=""><figcaption></figcaption></figure>

This would result in the below notification for the user (example data, for reference only)

<figure><img src="https://content.gitbook.com/content/NLqipxtUnsXueZRXkMI6/blobs/byUbNcFJlISYueIdF5Kb/ws8.png" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Custom Schedule" %}
Webhooks can be set to trigger automatically on a set schedule with the **webhookSchedule** attribute (only possible on Webhooks with Alert Scripts).

<figure><img src="https://content.gitbook.com/content/NLqipxtUnsXueZRXkMI6/blobs/IypF85pyyrIICZCj4zOl/image.png" alt=""><figcaption></figcaption></figure>

Preview of example above as part of an api request for creating a Webhook Subscription.

```
"webhookSchedule": {
    "intervalHours": 24,
    "intervalMinute": 0,
    "startupTimeHours": 12,
    "startupTimeMinutes": 0
}
```

{% endtab %}
{% endtabs %}

#### &#x20; Notifications

* Holds the list of notifications for those subscriptions which the user has access to.
  * Administrator can access all the notifications for all the subscriptions available in the system, while non admin users can access only the subscriptions for the given logged in user. For example,

<figure><img src="https://content.gitbook.com/content/NLqipxtUnsXueZRXkMI6/blobs/PYL23DIdE5i9uEwhO0ES/image.png" alt=""><figcaption></figcaption></figure>
