> ## 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.

# OpsGenie

> Create and resolve OpsGenie alerts automatically from DevHelm incident detection

Connect DevHelm to OpsGenie to automatically create and resolve alerts. Like PagerDuty, OpsGenie uses **trigger-resolve** lifecycle — alerts resolve automatically when the DevHelm incident clears.

## Setup

<Steps>
  <Step title="Create an OpsGenie API integration">
    1. In OpsGenie, go to **Settings** → **Integrations** → **Add Integration**
    2. Select **API** integration
    3. Copy the **API Key**
    4. Note your region (`us` or `eu`)
  </Step>

  <Step title="Create the alert channel in DevHelm">
    <CodeGroup>
      ```bash CLI theme={null}
      devhelm alert-channels create \
        --name "OpsGenie Alerts" \
        --type opsgenie \
        --config '{"channelType":"opsgenie","apiKey":"your-opsgenie-api-key","region":"us"}'
      ```

      ```yaml devhelm.yml theme={null}
      alertChannels:
        - name: OpsGenie Alerts
          config:
            channelType: opsgenie
            apiKey: ${OPSGENIE_API_KEY}
            region: us
      ```
    </CodeGroup>
  </Step>

  <Step title="Test the channel">
    ```bash theme={null}
    devhelm alert-channels test <channel-id>
    ```
  </Step>
</Steps>

## Configuration

| Field    | Description                         | Required |
| -------- | ----------------------------------- | -------- |
| `apiKey` | OpsGenie API key for alert creation | Yes      |
| `region` | OpsGenie API region: `us` or `eu`   | Yes      |

## Lifecycle behavior

| DevHelm event     | OpsGenie action                |
| ----------------- | ------------------------------ |
| Incident created  | Creates a new alert            |
| Incident resolved | Closes the corresponding alert |
| Incident reopened | Creates a new alert            |

## Troubleshooting

<AccordionGroup>
  <Accordion title="Alerts not creating">
    1. Verify the API key has permission to create alerts
    2. Confirm the region matches your OpsGenie account (US vs EU)
    3. Run `devhelm alert-channels test <id>`
  </Accordion>
</AccordionGroup>
