# Create Webhook Subscription

1. Open the **Webhooks** module in the **Alerts** section.
2. Click **Create Webhook Subscription**<img src="https://content.gitbook.com/content/uZ9lzqgHX4JL1Df67xog/blobs/1ydDqPILaXWojs1rrFAo/create-24px.svg" alt="" data-size="line">in the top right corner.
3. Fill in the required fields (marked with \*) for each step in the dialogue.
4. Click **Create**.

### Types of Webhook Subscriptions

There can be created 3 types of webhooks in VMS; HTTP, Email and Websocket. HTTP and Email send notifications to the specified destination, while Websocket sends push notifications to users through VMS. Each with different options to fill out. Illustrations and further descriptions are shown below for which fields need to be filled to create a new Webhook Subscription.

## Receiver Step

{% tabs %}
{% tab title="HTTP" %}

<figure><img src="https://3464155396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZ9lzqgHX4JL1Df67xog%2Fuploads%2FSgQKvFxpBLQUwi1nUiuz%2FScreenshot%202025-09-12%20at%2008.55.20.png?alt=media&#x26;token=a0591835-ce7f-43b1-9e1c-d78469491547" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3464155396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZ9lzqgHX4JL1Df67xog%2Fuploads%2FsoT6vh9Ss5nbBZi29o9y%2Fimage.png?alt=media&#x26;token=6bb3b697-c516-4409-95bb-94679f45a737" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Basic Authentication** requires filling out a `Username` and `Password` for the endpoint. **Request Token** requires filling out an `Access Token Request Url`  and an `Access Token Request Body` , with the other fields being optional.
{% endhint %}
{% endtab %}

{% tab title="Email" %}

<figure><img src="https://3464155396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZ9lzqgHX4JL1Df67xog%2Fuploads%2F52XehP1hslPLdk1y3Thh%2FScreenshot%202025-09-12%20at%2009.11.09.png?alt=media&#x26;token=9d2d9aa7-8c95-49bc-901c-193a2ea35422" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
No authentication configuration is required for email.
{% endhint %}
{% endtab %}

{% tab title="Websocket" %}

<figure><img src="https://3464155396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZ9lzqgHX4JL1Df67xog%2Fuploads%2FRow34jaoe4Z0YjbFEIo2%2Fimage.png?alt=media&#x26;token=cc99fe85-5771-4a89-b2b9-a73ee9554339" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
No authentication configuration is required for websocket.
{% endhint %}
{% endtab %}
{% endtabs %}

## Trigger Step

The Trigger is the condition that needs to be met for a notification to be sent to the Receiver. Either an existing Alert Script or an Expression can be selected.\
\
Below is an example Expression that needs the cargoQuantity of a Cargo to be changed, greater or equal to 1000, and that cargo's charterer to be equal to a specific user key. Limiting the number of notifications to be relevant and informative.

<figure><img src="https://3464155396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZ9lzqgHX4JL1Df67xog%2Fuploads%2F08F8RBn0DTZzQoq25zYR%2Fimage.png?alt=media&#x26;token=9922649a-cdf3-4d4d-81c1-56e7a596a8fd" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The `Field` can be selected with the Customize Columns modal, like in lists. Conditions can be customized in detail using grouping `Add Group` , to allow multiple combinations of `AND` /`OR` conditions. A simplified preview of the conditions are displayed at the bottom of the modal.
{% endhint %}

## Payload Step

**Template Message** and **Fields** are optional. **Template Message** allows for a custom message where field values from the object can be inserted in the sent notification.

<figure><img src="https://3464155396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZ9lzqgHX4JL1Df67xog%2Fuploads%2FCOMhOw6ectTxbWaTXGcA%2Fimage.png?alt=media&#x26;token=99439cfc-d1c7-49a4-be56-5d9b3400893d" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Fields** limit what fields should be returned in the notification and can look like this {"fieldName1":"\*","fieldName2":"\*"}. Read more about how to specify **Fields** [here](https://api.dataloy.com/dataloy-rest-api/adjust-number-of-fields-to-be-returned-from-a-request).
{% endhint %}

## General

All options are optional except **User**, which must be selected. This should in most cases be set to the user intended to receive the notification. As the permissions of that **User** decides the access to objects when the notification is sent. Failing notifications could be due to the **User** not having the right access.\
\
The description icon (**i)** can be hovered over to reveal additional information about their function.

<figure><img src="https://3464155396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZ9lzqgHX4JL1Df67xog%2Fuploads%2FXVajiiiqE6D1cJhyOrKd%2Fimage.png?alt=media&#x26;token=02afec26-f710-4f5c-a220-0292254ceea7" alt=""><figcaption></figcaption></figure>
