# Receiving Webhooks

This is a simple tutorial, if you want to **receive webhooks from an external system**, such as from payment providers, ERP systen and more.

The tutorial is not bound to a specific software or programming language.\
It just requires any local web application running on your development machine.

## 1. Start Web App

Start your local we application.\
That's it, just do it, however it works for you (Docker, native, ...) and make sure its reachable with HTTP or HTTPS.

## 2. Start Tunnel

You can now decide what service you want to use for your tunnel.

{% tabs %}
{% tab title="NGROK" %}
We start by running our tunnel. In this case with NGROK.\
If you are not yet familiar with NGROK you might want to check it out here: <https://ngrok.com/>

All we need is to run this line with port 443 (or 80 if you have http only) and with our hostname. This will make sure that our app thinks there is a request for this hostname, and not for the NGROK domain that would be used otherwise.

```bash
ngrok http --region=eu --host-header={my-hostname} 443
```

{% endtab %}

{% tab title="Cloudflare" %}
If you want to use the Cloudflare service, run the following command.\
This will start a tunnel that redirects to your HTTPS localhost. You can also use HTTP if you prefer that.\
\
It will also ensure sure that our app thinks there is a request for our static hostname, and not for the Cloudflare domain that would be used otherwise.

```
cloudflared tunnel --no-tls-verify --http-host-header={my-hostname} --url=https://localhost
```

{% endtab %}
{% endtabs %}

## 3. Update SquadDNS

The only thing that's left to do is, to copy the generated tunnel domain and add it to your record inside SquadDNS.

{% hint style="success" %}
That's it!\
You can now use your static domain in your webhook URL for your external system.\
If that system now calls the webhook, you should receive it locally.
{% endhint %}


---

# 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.squad-dns.com/tutorials/receiving-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.
