Skip to main content

Setup

Install the Opsgenie integration from the Courier integrations catalog.
To configure the Opsgenie provider, you must set a value in the Message field in the channel configuration. You can use a static message or enhance it with the data property in the API call payload.
OpsGenie Channel Configuration

Profile Requirements

Opsgenie does not require any profile data. If you include the Opsgenie channel in your notification template, Courier will route the notification to Opsgenie.
{
  "message": {
    "to": {},
    "template": "TEMPLATE_ID"
  }
}
To add dynamic content to your message, include the data property in the API call payload:
{
  "message": {
    "data": {
      "metadata": {
        "greeting": "Hey... DO NOT PANIC..."
      }
    },
    "providers": {
      "opsgenie": {
        "override": {
          "config": {
            "apiKey": "YOUR_OPSGENIE_API_KEY"
          }
        }
      }
    },
    "template": "TEMPLATE_ID",
    "to": {}
  }
}
After processing the request, the notification will include the value from the data property.
OpsGenie Resulting Notification

Overrides

You can use overrides to change the configuration or request body that Courier sends to Opsgenie. For example, you can change the API key or the message body.
If you are using Opsgenie in the Europe region, use the URL https://api.eu.opsgenie.com/v2 and the API key associated with your EU instance.
{
  "message": {
    "template": "TEMPLATE_ID",
    "to": {},
    "providers": {
      "opsgenie": {
        "override": {
          "config": {
            "apiKey": "YOUR_OPSGENIE_API_KEY",
            "url": "https://api.eu.opsgenie.com/v2"
          },
          "headers": {},
          "body": {
            "message": "YOUR MESSAGE"
          }
        }
      }
    }
  }
}