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

# Level alert integration

> Send Level device alert triggers and resolutions to Flashduty On-call through a webhook.

Use webhooks in Level (level.io) to send device alerts to Flashduty On-call. Level sends `alert_active` when an alert is raised and `alert_resolved` when it is resolved. Flashduty correlates the two by the alert `id`: it creates an alert on trigger and recovers it on resolution.

<div className="hide">
  ## In Flashduty On-call

  ***

  You can obtain an integration push URL in either of the following ways.

  ### Use a dedicated integration

  1. In the Flashduty console, select **Channel** and open a channel
  2. Select **Configuration** → **Integrations** → **Private integration**, then click **Add an integration**
  3. Select **Level**, then click **Save**
  4. Open the generated integration card and copy the **Push URL**

  ### Use a shared integration

  1. In the Flashduty console, select **Integration Center → Alert Events**
  2. Select **Level** and enter an integration name
  3. Configure the default route and select a channel; after creation, add more rules under **Route** if needed
  4. Click **Save** and copy the generated **Push URL**
</div>

## Configure Level

***

<Steps>
  <Step title="Add a webhook">
    1. Sign in to Level and go to **Settings → Webhooks**
    2. Create a webhook and paste the full Flashduty push URL, including `integration_key`, as the URL
    3. Select the events `alert_active` and `alert_resolved`. If only `alert_active` is selected, alerts are never recovered automatically
    4. The secret can be left empty. When a secret is set, Level adds an HMAC-SHA256 signature in the `X-Level-Signature` header; Flashduty does not verify it and authenticates with the `integration_key` in the push URL
  </Step>

  <Step title="Save and verify">
    1. Save the webhook
    2. Trigger a device alert in Level and confirm Flashduty receives an active alert
    3. After the alert is resolved in Level, confirm the matching Flashduty alert recovers
    4. The Webhooks page in Level shows the status code and response of each delivery, and **Re-run request** resends one

    Level's documentation does not say whether the webhook has a test button or what a test request contains.
  </Step>
</Steps>

## Alert Key

***

Flashduty uses `data.id` (the Level alert ID) as the Alert Key, so `alert_active` and `alert_resolved` for the same alert share one Alert Key. Changes to the alert name, description, severity, or device hostname do not change it. Level's `event_id` identifies an event and stays the same across retries and manual re-runs; Flashduty does not use it as the Alert Key. Requests without `data.id` are rejected.

## Status and severity

***

| Event type | Status |
| :- | :- |
| `alert_active` | Trigger |
| `alert_resolved` | Recovery |

The `device_created`, `device_updated`, `device_deleted`, `group_created`, `group_updated`, and `group_deleted` events are not alerts; Flashduty returns success and creates nothing.

Severity comes from `data.severity`:

| Level severity | Flashduty severity |
| :- | :- |
| `information` | Info |
| `warning` | Warning |
| `critical` | Critical |
| `emergency` | Critical |
| Missing or other | Warning |

A recovery event keeps the alert's existing severity.

## Labels

***

| Label | Source |
| :- | :- |
| `source` | Always `level` |
| `event_type` | Event type |
| `alert_id` | `data.id` |
| `device_id` | `data.device_id` |
| `host` | `data.device_hostname` |
| `check` | `data.name` |
| `level_severity` | Raw `data.severity` |
| `started_at` / `resolved_at` | Alert start and resolution time |

The alert title is `hostname: alert name`, and the description comes from `data.description` and `data.payload`.

## Troubleshooting

***

* **Flashduty returns a parameter error**: check that the URL is complete and includes `integration_key`, and that the request body is in Level's webhook format
* **Alerts do not recover**: check that the webhook has `alert_resolved` selected
* **The same event arrives more than once**: Level retries failed deliveries automatically; repeated deliveries of the same alert merge into one Flashduty alert

For field details, see the [Level webhooks developer guide](https://docs.level.io/en/articles/16650292-webhooks-developer-guide).
