# Set the webhook link to the channel

This article will tell you the ways in which you can install and configure a webhook on an instance (Whapi channel).

From where and how to get or create a webhook link, have covered in this article: [where-to-find-the-webhook-url](https://support.whapi.cloud/help-desk/receiving/webhooks/where-to-find-the-webhook-url "mention")

#### Using the interface

One of the advantages of Whapi.Cloud is the ability to flexibly and automatically customize and manage hooks to your liking, and a lot of advanced settings will simplify your work.

{% hint style="info" %}
When you connect a channel, you'll be prompted to personalize it. For example, give the channel a name, customize webhooks, and change other settings according to your preferences. However, you can skip these steps and come back to them later.
{% endhint %}

To set the webhook after initializing the channel, go to the channel settings (the button in the upper right corner). The first block is the webhooks section. Specify the URL of your server to which notifications will be sent.  Click **Check webhook** to make sure your server accepts requests. Add and check other hooks if necessary.

That is, every time the connected number receives an interaction, we will make a request with the `POST`/`PUT`/`PATCH`/`DELETE` method to the previously configured URL.&#x20;

(For each request there is a [specific JSON body](https://support.whapi.cloud/help-desk/receiving/webhooks/incoming-webhooks-format)).

You can learn how to process incoming data in separate tutorials here:

[receive-messages](https://support.whapi.cloud/help-desk/receiving/webhooks/receive-messages "mention")

<figure><img src="https://2417185145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhsdgGmVCG31mEaHyRvxC%2Fuploads%2FGx0qUi02KFNpriZPZoi5%2Fsettings-whapi.png?alt=media&#x26;token=25ce50f5-869f-4a1f-a175-8fa8c2481274" alt=""><figcaption><p>Channel settings after it is connected to your number</p></figcaption></figure>

Details on all the fine points of customization, each customization [mode](https://support.whapi.cloud/help-desk/receiving/detailed-webhook-settings#mode-setting) and [events](https://support.whapi.cloud/help-desk/receiving/webhooks/our-webhooks-tracked-events) will be explained later.

#### Set hooks via API

You can also install webhooks and update all settings via API. To do this, use the method of updating channel settings:

{% embed url="<https://whapi.readme.io/reference/updatechannelsettings>" %}
Set hooks via API
{% endembed %}

```bash
curl --request PATCH \
     --url https://gate.whapi.cloud/settings \
     --header 'accept: application/json' \
     --header 'authorization: Bearer TOKEN' \
     --header 'content-type: application/json' \
     --data '
{
  "webhooks": [
    {
      "mode": "body",
      "events": [
        {
          "type": "messages",
          "method": "post"
        }
      ],
      "url": "https://webhook.site/11ab0eeb-dc98-4ccd-a2d3-be2b182b9de0"
    }
  ],
  "offline_mode": false,
  "full_history": false
}
'
```

If a field is not present in the request, no change is made to that setting. For example, if 'proxy' is not sent with the request, the existing configuration for 'proxy' is unchanged.

{% hint style="success" %}
We offer a number of settings that affect the amount of data sent by the server, these settings can be changed in the interface or through the API. More information about this in the manual: [detailed-webhook-settings](https://support.whapi.cloud/help-desk/receiving/webhooks/detailed-webhook-settings "mention")
{% endhint %}

## How do I check if callbacks are being sent from a channel?

For a quick check, you can use the built-in "Check webhook" button in the channel settings interface.

We also offer a dedicated endpoint for this purpose, allowing you to simulate any callback for any event. This way, you can test the availability of your link to our API and see the format of the callback itself.

{% embed url="<https://whapi.readme.io/reference/webhooktest>" %}
Emulates a test callback to your link
{% endembed %}
