> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allquiet.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhook

> Connect Any Third-Party Platform with All Quiet via `HTTP calls`

<Info>Setup time: 6 Min</Info>

Maximize your team's efficiency with All Quiet's outbound webhooks. Connect seamlessly with third-party platforms, enabling real-time alerts and maintaining operational awareness.

## Create Outbound Integration

1. Click on the `Outbound Integrations` tab.
2. Click on `+ Create`.

<img className="Webhook_Create" src="https://mintcdn.com/allquiet/P8t56GT-09l8Ew6U/images/webhook/01.png?fit=max&auto=format&n=P8t56GT-09l8Ew6U&q=85&s=2628880d546bbc086e07c5f2fbea39dc" width="2674" height="642" data-path="images/webhook/01.png" />

1. Enter a `Display Name` for your integration, e.g. "Outbound Webhook".
2. Select a `Team`. <Note>For Organizations with Pro and Enterprise plan: This is going to be the root team of your integration. You will be able to add additional teams in the next step.</Note>
3. Select `Webhook` as the integration's type.
4. Forwarding settings:
   1. **Default:** `Always` will automatically forward all incidents to your Webhook, unless excluded by [advanced routing rules](/advanced/routing).
   2. **Alternative 1**: `Always After Forwarding` will only sent requests if users [manually forward specific incidents](/essentials/incident#forwarding) or if you set up [advanced routing rules](/advanced/routing) for your Webhook Outbound integration that automatically forward incidents in specific scenarios. **After Forwarding, all updates** of the incident **will also be pushed to the Outbound Webhook**.
   3. **Alternative 2**: `Only On Forwarding` will only forward a snapshot of the current incident history to your Outbound Webhook in the moment users [manually forward specific incidents](/essentials/incident#forwarding) or if you set up [advanced routing rules](/advanced/routing) for your Webhook Outbound integration that automatically forwards incidents in specific scenarios. We will **not send** any incident **updates** to the Outbound Webhook **afterwards**.
      <Tip>You can change your selection anytime.</Tip>
5. Click `Create Outbound Integration`.

<img className="Webhook_Create2" src="https://mintcdn.com/allquiet/P8t56GT-09l8Ew6U/images/webhook/02.png?fit=max&auto=format&n=P8t56GT-09l8Ew6U&q=85&s=6d9c0db0b14bb9df9d2afdbe4ef1b8aa" width="2126" height="1808" data-path="images/webhook/02.png" />

After successfully creating your new outbound integration, you'll be redirected to the details page automatically.

<Note>**Only for Pro and Enterprise plan:** The root team is pre-selected, and you can add the integration to further teams within the root team's organization. *Team Administrators* can add / remove those teams they are an admin in, *Organization Administrators* & *Organization Owners* can manage the connections to all teams of the organization. </Note>

<img className="Webhook_Create3" src="https://mintcdn.com/allquiet/P8t56GT-09l8Ew6U/images/webhook/03.png?fit=max&auto=format&n=P8t56GT-09l8Ew6U&q=85&s=82afc6edd002b3a10c2c95a78a2102fb" width="2122" height="936" data-path="images/webhook/03.png" />

## Configure Webhook Request

To configure webhook requests in the All Quiet incident management tool, you would typically follow these steps:

* **Load an Incident:** Choose an incident from your list to serve as a test case.
* **Write a Template:** Craft a Handlebars template that converts the incident data into a webhook request payload.
* **Review & Dispatch:** Examine the generated request for accuracy, then save and trigger a test request to confirm the integration works as expected.

### Load Incident Model for Testing

1. Select an incident. This incident acts as a sample to define how the webhook should behave.
2. Clicking on an incident will populate its JSON structure in the test area (2), allowing you to use real incident data to model the webhook request.

<img className="Webhook_Load" src="https://mintcdn.com/allquiet/P8t56GT-09l8Ew6U/images/webhook/04.png?fit=max&auto=format&n=P8t56GT-09l8Ew6U&q=85&s=d8284cfd6ba0e7e0c62f76a850999813" width="2160" height="1408" data-path="images/webhook/04.png" />

### Write a Template

With the incident data loaded, navigate to the `Template` section. Here, use [Handlebars syntax](https://handlebarsjs.com/guide/) to map the incident data fields to the corresponding webhook JSON structure. This template determines how the incident data is transformed into the format required by the receiving endpoint. Here, you need to add the `URL` you want to sent the Outbound Webhook to.

<img className="Webhook_Template" src="https://mintcdn.com/allquiet/P8t56GT-09l8Ew6U/images/webhook/05.png?fit=max&auto=format&n=P8t56GT-09l8Ew6U&q=85&s=702e3c0bf04d17ee71b80ecdac0f08ff" width="2178" height="678" data-path="images/webhook/05.png" />

The following JSON structure provides a template for sending a webhook request. You can modify the `method`, `url`, `headers` values, and the `body` content to fit the specific requirements of your webhook integration.

For each new incident event, such as creation, resolution, or commenting, All Quiet will send an HTTP call with the specified method, headers, and body to the URL defined in the webhook request JSON.

```JSON theme={null}
{
    "method": "POST",
    "url": "https://your-url.com",
    "headers": {
        "Content-Type": "application/json; charset=utf-8",
        "X-Your-Header": "abc"
    },
    "body": {
        "text": "Your Text Content",
        "formData": {
            "key1": "a",
            "key2": "b"
        },
        "json": {
            "prop1": "a",
            "prop2": {
                "someArray": [{"k": "v"}]
            }
        }
    }
}
```

Only one of `text`, `formData`, and `json` is used. If you specify more than one, the first one is used.

### Outbound IP Addresses

The outbound IP addresses used for webhook requests are dynamic and can be retrieved from the following endpoints:

* US Region: [https://allquiet.app/api/public/v1/metadata/ips](https://allquiet.app/api/public/v1/metadata/ips)
* EU Region: [https://allquiet.eu/api/public/v1/metadata/ips](https://allquiet.eu/api/public/v1/metadata/ips)

While these IP addresses are generally stable, we do not guarantee their persistence. It's recommended to regularly check these endpoints for any changes.

### Inspect and Send Webhook Request

1. In the 'HTTP Request' section, review the final payload based on your template. This is where you ensure that all necessary data is correctly formatted and included.
2. Optionally, you can sign the request. As `Signing Method`, we currently support "HMAC-SHA256 (All Quiet)" or "HMAC-SHA256 (AWS DevOps Agent)". Don't forget to add your `Signing Secret` when adding a signature.
3. After confirming the request and selected signing method are accurate, save the mapping.
4. Use the `Trigger Dummy Request` button to test the webhook, validating the end-to-end process.
5. The recorded request and response will be visible in the right pane under "Latest Requests".

<img className="Webhook_Send" src="https://mintcdn.com/allquiet/17T5r-0yZPeoTX-s/images/webhook/06.png?fit=max&auto=format&n=17T5r-0yZPeoTX-s&q=85&s=5e1533cf3db1226a543786ae17c69a66" width="2166" height="2206" data-path="images/webhook/06.png" />

<Check> You now integrated outbound webhooks with All Quiet, simplifying incident management by consolidating notifications and actions in your place of choice.</Check>

### Update / Patch Incidents via Outbound Webhook

In addition to only sending an All Quiet incident to another tool via the Outbound Webhook, you can also use it **to patch (update) the incident** directly.
This can be valuable when you want to trigger a certain action or when you simply want to enrich the incident by sending it to your Outbound Webhook.

To allow incident patching via Outbound Webhook

1. Adjust your Outbound Webhook's [request template](/integrations/outbound/webhook#write-a-template) and add `"enableIncidentUpdates": true`.

<img className="Webhook_Patch" src="https://mintcdn.com/allquiet/P8t56GT-09l8Ew6U/images/webhook/07.png?fit=max&auto=format&n=P8t56GT-09l8Ew6U&q=85&s=f8fcf274183f2844cfaa1b321821b06a" width="1886" height="686" data-path="images/webhook/07.png" />

2. Prepare a patch response from the URL you're sending the incident to. Find a few examples for patches below. The whole list of patches we allow can be retrieved via our [Public API Documentation,"IncidentResource" Patch](https://allquiet.app/api/public/swagger-ui/index.html).

<AccordionGroup>
  <Accordion title="Use Case 1: Resolve Incident When Sent to Outbound Webhook">
    To resolve an incident as soon as it's send to the outbound webhook, send this patch as response to the Outbound Webhook.

    ```

    {
    "operations": {
        "appendIntent": {
            "intent": "Resolved"
            }
        }
    }   

    ```

    The incident will be updated as `resolved` by your Outbound Webhook Integration.
  </Accordion>

  <Accordion title="Use Case 2: Add Attribute To Incident When Sent to Outbound Webhook">
    In this example we want to add a new attribute to the incident, a URL to the tool which the incident was sent to by the Outbound Webhook.

    ```

    {
    "operations": {
        "addAttributes": {
          "attributes": [
            {
              "name": "ExampleToolURL",
              "value": "https://exampleurl.com/ID",
              "isImage": false,
              "hideInPreviews": false
            }
          ]
        }
      }
    }   
    ```

    The incident will be updated a by your Outbound Webhook Integration, including the new attribute "OutboundID".
  </Accordion>
</AccordionGroup>
