# Receiving Webhooks with Sensitive Data

A Webhook is an HTTP callback: an HTTP POST that occurs when something happens; a simple event-notification via HTTP POST. A web application implementing WebHooks will POST a message to a URL when certain things happen.

Integrating Slack with VGS, we can show how to set up webhooks on a real example.

First of all, we need to have or [create](https://slack.com/intl/en-ua/get-started#/create) a Slack account. Then we should create an app within Slack to use incoming webhooks in order to post messages into Slack. Follow this [guide](https://api.slack.com/messaging/webhooks) to set it up.

Once the Slack application is created, we will have a webhook URL to send messages in JSON as the body of an `application/json` POST request.

In order for us to set up integration with VGS, we need to create an inbound route to redact the message by using Upstream Host: `hooks.slack.com`. We will use `ContentType` as `application/json` and `PathInfo` should contain the webhook URL path.&#x20;

<figure><img src="/files/3nfDjKj1Ftmu39AQsR7O" alt=""><figcaption></figcaption></figure>

Once we have inbound route set up, we can send the curl request with the text message, using the following shortcut:

```bash
curl https://<VAULT_ID>.sandbox.verygoodproxy.com/URL_PATH \\n
  -H "Content-type: application/json" \\n
  -d '{"text": "message"}'
```

The message will be redacted into the alias and posted to the predefined channel.

In order to reveal the message, we need to create the outbound route to Reveal the message. The Upstream host will stay the same: `hooks.slack.com`. We will use the same settings for `ContentType` and `PathInfo`.&#x20;

<figure><img src="/files/QT5P6jf2xSZlNYEUBmTu" alt=""><figcaption></figcaption></figure>

Once we have the outbound route set up, we can send the curl request using the following shortcut:

```bash
curl https://hooks.slack.com/URL_PATH -k \\n
  -x https://<CREDENTIALS>@<VAULT_ID>.sandbox.verygoodproxy.com:8443 \\n
  -H "Content-type: application/json" \\n
  -d '{"text": "ALIAS"}'
```

The message will be revealed and posted to the predefined channel.

That is the basic example of using webhooks with VGS. Using this algorithm, we can set up VGS integration with any other application (on a webhook basis).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.verygoodsecurity.com/vault/example-integrations/webhooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
