Create Opsgenie alerts from scheduled checks

Open Opsgenie alerts from checks that run on a timer, or as recurring reminders your on-call team can acknowledge.

Example: a weekly certificate review

json
{
  "name": "Certificate expiry review",
  "cron": { "expression": "0 10 * * MON", "time_zone": "Europe/Dublin" },
  "nodes": [
    { "id": "certs", "request": { "method": "GET", "endpoint": "https://api.acme.com/internal/certs/expiring?days=21", "credential_id": "YOUR_INTERNAL_TOKEN_ID" } },
    { "id": "alert", "opsgenie_create_alert": {
        "credential_id": "YOUR_OPSGENIE_KEY_ID",
        "message": "{{ $.count }} certificates expire within 21 days",
        "description": "{{ join($.domains, \"\\n\") }}",
        "priority": "P3" } }
  ]
}

Set up

Add an API integration to an Opsgenie team and save its key and region (US or EU) as an opsgenie credential.

Reference

Create an Opsgenie alert: opsgenie_create_alert

Sends POST https://api.opsgenie.com/v2/alerts (or the EU host) with header Authorization: GenieKey …. Output for the next step: Opsgenie’s response, with the requestId.

Field Type Notes
credential_id string, required The id of a opsgenie credential holding an API integration key and its region.
message string, required Up to 130 characters. Placeholders allowed.
description string Up to 15,000 characters. Placeholders allowed.
priority string P1 (highest) to P5. Omit for Opsgenie’s default.