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

# Your First Alert

> Set up your first DevHelm alert channel and notification policy to get notified when monitors fail

By the end of this guide, you'll have an alert channel connected and a notification policy routing incidents to it.

<Accordion title="Prerequisites">
  * DevHelm CLI installed or an API token for REST calls
  * An API token set as `DEVHELM_API_TOKEN` — see [Authentication](/authentication)
  * At least one monitor running — see [First HTTP monitor](/guides/first-http-monitor)
  * A Slack webhook URL, email address, or other alert destination
</Accordion>

## Set up alerting in three steps

<Steps>
  <Step title="Create an alert channel">
    An alert channel is a configured destination. Start with whichever integration you use:

    <CodeGroup>
      ```bash Slack theme={null}
      devhelm alert-channels create \
        --name "Engineering Slack" \
        --type slack \
        --webhook-url "https://hooks.slack.com/services/T.../B.../xxx"
      ```

      ```bash Email theme={null}
      devhelm alert-channels create \
        --name "On-Call Email" \
        --type email \
        --config '{"recipients": ["oncall@example.com"]}'
      ```

      ```bash Webhook theme={null}
      devhelm alert-channels create \
        --name "Custom Webhook" \
        --type webhook \
        --webhook-url "https://example.com/webhooks/devhelm"
      ```
    </CodeGroup>

    Save the channel ID from the output — you'll need it in the next step.
  </Step>

  <Step title="Test the channel">
    Verify the channel is configured correctly before using it:

    ```bash theme={null}
    devhelm alert-channels test <channel-id>
    ```

    You should see a test notification arrive at your destination.
  </Step>

  <Step title="Create a notification policy">
    A notification policy connects incidents to channels. Start with a catch-all policy that routes all incidents:

    <CodeGroup>
      ```bash CLI theme={null}
      devhelm notification-policies create \
        --name "All incidents" \
        --channel-ids "<channel-id>"
      ```

      ```bash API theme={null}
      curl -X POST https://api.devhelm.io/api/v1/notification-policies \
        -H "Authorization: Bearer $DEVHELM_API_TOKEN" \
        -H "Content-Type: application/json" \
        -d '{
          "name": "All incidents",
          "matchRules": [],
          "escalation": {
            "steps": [{
              "delayMinutes": 0,
              "channelIds": ["<channel-id>"]
            }],
            "onResolve": "notify_all_steps"
          }
        }'
      ```
    </CodeGroup>

    An empty `matchRules` array is a catch-all — it matches every incident.
  </Step>
</Steps>

## Verify end-to-end

The easiest way to test the full pipeline is to create a monitor that will fail:

```bash theme={null}
devhelm monitors create \
  --name "Alert Test (delete me)" \
  --type HTTP \
  --url https://httpstat.us/500 \
  --frequency 30 \
  --regions us-east
```

Wait for the default incident policy to trigger (2 consecutive failures ≈ 1 minute), then check that your notification arrives. Delete the test monitor when done:

```bash theme={null}
devhelm monitors delete <test-monitor-id>
```

## What happens when an incident fires

1. A monitor's checks fail and match its [trigger rules](/incidents/policies#trigger-rules)
2. The [confirmation policy](/incidents/policies#confirmation) validates failures across regions
3. The incident moves to `CONFIRMED` status
4. DevHelm evaluates all enabled notification policies — yours matches
5. The escalation chain executes — your channel receives a notification
6. When the monitor recovers, a resolution notification is sent (based on `onResolve`)

## Next steps

<CardGroup cols={2}>
  <Card title="Alerting guide" icon="bell" href="/guides/alerting">
    Build tiered escalation and scoped policies.
  </Card>

  <Card title="Alert channels" icon="plug" href="/alerting/channels">
    All seven channel types and their configuration.
  </Card>

  <Card title="Notification policies" icon="filter" href="/alerting/notification-policies">
    Match rules, priority, and evaluation logic.
  </Card>

  <Card title="Integrations" icon="puzzle-piece" href="/integrations/slack">
    Detailed setup for Slack, PagerDuty, and more.
  </Card>
</CardGroup>
