> For the complete documentation index, see [llms.txt](https://docs.verygoodsecurity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verygoodsecurity.com/vault/example-integrations/webhooks.md).

# 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="https://2096104711-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUreALQAfVnRMQEz110rC%2Fuploads%2Fgit-blob-71807c8f783ab75edae1fcccdf6bba76c4dfbc14%2Fwebhooks_inbound.png?alt=media" 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="https://2096104711-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUreALQAfVnRMQEz110rC%2Fuploads%2Fgit-blob-c1d1ca88b67b12fd1ef391174116bf997987013d%2Fwebhooks_outbound.png?alt=media" 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
