# Opsgenie

## Configure Opsgenie notifications

To send notifications to Slack follow these steps:

1. [Create an integration in OpsGenie](#create-integration)
2. [Create the channel](#create-and-test-the-channel)

### Create integration

In order to integrate StackState with OpsGenie, a global "API key" needs to be created. The responders for a notification can be different for each notification and will be configured in StackState.

In Opsgenie, go to "Settings -> Integrations".

* Click the "Add integration" button
* Search for the "API" integration type.
* Choose a name for this integration, but *do not select an Assignee team*.

When the integration has been created, it will have an "API key".

### Create and test the channel

![Create the channel](https://2245176135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNEvjJkYDpdslyPRQlRIf%2Fuploads%2Fgit-blob-ab2702cb4d5a87d7ff45e7868cd633f2c5ef18ca%2Fnotifications-opsgenie-channel-configuration.png?alt=media)

Select the appropriate region for your OpsGenie account and enter the "API key". Choose responders for the notification; *users*, *teams*, *schedules* and *escalations* are available for this.

Click the "Add channel" button. This adds the channel to the list of channels on the right. It will show a "Test" button. Pressing it will generate a test alert in OpsGenie.

## OpsGenie alerts for notifications

When a notification is opened a new OpsGenie alert is created. This message will be updated for changes, usually only when the health state changes. When the notification is closed the OpsGenie alert is closed again. A note on the alert contains the reason for closing it.

<figure><img src="https://2245176135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNEvjJkYDpdslyPRQlRIf%2Fuploads%2Fgit-blob-7e81c21e69521d719c37bc3504dfb14994c59f03%2Fnotifications-opsgenie-alert-example.png?alt=media" alt="Opsgenie alert" width="75%"><figcaption><p>An OpsGenie alert generated by StackState</p></figcaption></figure>

## Related

* [Troubleshooting](https://archivedocs.stackstate.com/monitors-and-alerts/notifications/troubleshooting)
