# Anomaly Webhook

By creating a webhook for [Anomalies](https://docs.apono.io/docs/architecture-and-security/anomalies) notifications, you can gather all notifications into a single platform.

***

### Prerequisites

<table><thead><tr><th width="246">Item</th><th>Description</th></tr></thead><tbody><tr><td><strong>Apono Premium</strong></td><td><a href="https://www.apono.io/pricing/">Apono plan</a> providing the most features and dedicated account support</td></tr><tr><td><strong>Access Flow</strong></td><td>Minimum of one configured <a href="../access-flows/creating-access-flows-in-apono/self-serve-access-flows">self serve</a> access flow</td></tr></tbody></table>

***

### Create a webhook

Follow these steps to configure an Apono webhook:

1. On the [**Webhooks**](https://app.apono.io/webhooks) page, click **Add Webhook**. The **Add Webhook** page appears.
2. Click **Anomaly Webhook**.
3. Enter a unique, alphanumeric, user-friendly **Anomaly Webhook Name** for identifying this webhook.
4. Click the **Status** toggle to **Active**.
5. From the **Method** dropdown menu, select a REST method.
6. In the **URL** field, enter the URL of the target system that will receive the webhook.

{% hint style="warning" %}
The webhook URL **must adhere** to the following requirements:

* Uses the HTTPS protocol
* Does not specify any custom ports
  {% endhint %}

7. In the **Body Template** field, construct a JSON body for the webhook payload.

{% hint style="success" %}
Click **View request anomaly event's payload schema** to reveal the payload schema and available data fields.
{% endhint %}

8. Enter the authentication information required by the target system.

{% tabs %}
{% tab title="Bearer Token" %}
Follow this step to add Bearer Token authentication:

1. Under **Headers**, use the **Key** and **Value** fields to set the access token.

| Key             | Value                  |
| --------------- | ---------------------- |
| *Authorization* | *Bearer \<API\_TOKEN>* |
| {% endtab %}    |                        |

{% tab title="OAuth" %}
Follow these steps to add OAuth authentication:

1. From the **Authentication Type** dropdown menu, select **OAuth**. The OAuth settings appear.
2. Define the OAuth settings.

<table><thead><tr><th width="204">Setting</th><th>Description</th></tr></thead><tbody><tr><td><strong>Client ID</strong></td><td>Unique identifier assigned by the authorization server</td></tr><tr><td><strong>Client Secret</strong></td><td>Secret key issued by the authorization server</td></tr><tr><td><strong>Token Endpoint URL</strong></td><td>URL where the authorization code or refresh token is exchanged for an access token</td></tr><tr><td><strong>Scopes</strong></td><td>(Optional) Set of permissions requested to access specific resources or APIs</td></tr></tbody></table>
{% endtab %}

{% tab title="" %}
Follow these steps to add OAuth authentication:

1. From the **Authentication Type** dropdown menu, select **OAuth**. The OAuth settings appear.
2. Define the OAuth settings.

<table><thead><tr><th width="204">Setting</th><th>Description</th></tr></thead><tbody><tr><td><strong>Client ID</strong></td><td>Unique identifier assigned by the authorization server</td></tr><tr><td><strong>Client Secret</strong></td><td>Secret key issued by the authorization server</td></tr><tr><td><strong>Token Endpoint URL</strong></td><td>URL where the authorization code or refresh token is exchanged for an access token</td></tr><tr><td><strong>Scopes</strong></td><td>(Optional) Set of permissions requested to access specific resources or APIs</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

9. (Optional) In the **Timeout in seconds** field, enter the duration in seconds to wait before marking the request as failed.
10. Optional) Define **Response Validators** to verify that the response from the webhook meets specified criteria:
    1. Click **+ Add**. A row of settings appears.
    2. Starting with *$.data.*, enter the **Json Path** of the JSON parameter.
    3. In the **Expected Values** field, enter a value and press the Enter key on your keyboard.
    4. Repeat step **c** to add several expected values.
    5. Repeat steps **a-d** to add multiple response validators.
11. Click **Test** to generate a test event to trigger your webhook. A **Test successful** or **Test failed** response status will appear at the bottom of the page. A successful test will send mock data to the target system.

{% hint style="success" %}
For more information about the test, click **View Invocation Data**. A panel opens revealing the request, response, and other relevant details.

Should your test fail, view these tips to [troubleshoot your webhook](https://docs.apono.io/docs/webhook-integrations/troubleshoot-a-webhook).
{% endhint %}

12. Click **Save Webhook.**

The new webhook appears in the **Webhooks** table. Active webhooks are preceded by a green dot. Inactive webhooks are preceded by a white dot.

Apono Anomalies notifications will be sent to the target system.


---

# 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.apono.io/docs/webhook-integrations/anomalies.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.
