LandfallDocs
Triggering integrations · Opsgenie

Opening a war room from an Opsgenie alert

An Opsgenie Webhook integration posts each alert action to Landfall. A Create opens a war room, or attaches to the open one for the same alert; Acknowledge and Close are recorded on that room. This page is not about the API key; see Connecting Opsgenie. The two are independent.

Opsgenie
alert action
→
Webhook integration
secret in a header
→
Landfall
opens or attaches an incident

How it works

Opsgenie posts to https://api.landfalls.ai/triggers/opsgenie, one URL for every organization. Each delivery carries your organization's webhook secret in the x-landfall-opsgenie-secret header. Landfall keeps only the secret's SHA-256 hash and finds your organization from it; nothing in the body decides the organization.

Landfall reads the body's action and alert.alertId. It acts on Create, Acknowledge and Close and accepts every other action without doing anything. Every follow-up attaches by the Opsgenie alert id.

What you'll need

  • An admin on your Landfall organization, to issue the secret.
  • An Opsgenie account that can add a Webhook integration.
  • curl and jq for step 1.

1. Issue a webhook secret

There is no button for this yet, so an admin issues it with one API call. The secret is shown once; Landfall keeps only its hash. Issuing again replaces it, and the old secret stops working at once.

Terminal
SESSION=$(curl -s -X POST https://api.landfalls.ai/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"<you>","password":"<your password>","orgSlug":"<your-org-slug>"}' \
  | jq -r .accessToken)

curl -X POST https://api.landfalls.ai/o/<your-org-slug>/triggers/opsgenie-secret \
  -H "Authorization: Bearer $SESSION"

The answer is {"secret":"<64 hex characters>"}. Keep it for the next step.

2. Point Opsgenie at Landfall

In Opsgenie, open Settings → Integrations → Add integration → Webhook and point it at Landfall with the secret as a custom header:

Webhook URLhttps://api.landfalls.ai/triggers/opsgenie
Header namex-landfall-opsgenie-secret
Header valueThe secret from step 1
Actions to forwardCreate, Acknowledge and Close. Landfall ignores any other action it receives.

What each action does

Opsgenie actionIn Landfall
CreateOpens a war room when the alert has no room, or its room is no longer open. When its room is still open, attaches to it and writes nothing.
AcknowledgeAppends opsgenie.alert.acknowledged to the alert's room.
CloseAppends opsgenie.alert.closed. It does not close the war room.
Any other actionAccepted and ignored.

What Opsgenie's fields become

Opsgenie fieldBecomes
alert.alertIdThe attach identity. A delivery without it is accepted and ignored.
alert.messageThe incident title. Without one, Opsgenie alert.
alert.prioritySeverity: P1 → sev1, P2 → sev2, anything else or none → sev3.
alert.tagsThe first non-empty tag names the affected service. service:checkout resolves to that service; a bare tag such as prod does not.
alert.sourceThe service when there are no tags, and part of the summary line Opsgenie alert (<source>): <title>.
alert.updatedAt, alert.createdAtWhen an Acknowledge or Close is recorded as having happened; the time Landfall received it when neither is usable.

3. Test it

Post a Create the way Opsgenie would:

Terminal · Worked example
curl -i -X POST https://api.landfalls.ai/triggers/opsgenie \
  -H "x-landfall-opsgenie-secret: <your secret>" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "Create",
    "alert": {
      "alertId": "a1b2c3d4-0000-4000-8000-000000000000",
      "message": "Checkout latency above SLO",
      "priority": "P2",
      "source": "acme-monitoring",
      "tags": ["service:checkout"]
    }
  }'

The answer is 202 with {"outcome":"opened","incidentId":"<id>"}. The room is titled Checkout latency above SLO at sev2 and appears in your Incidents list with an Opsgenie source badge. Send the same body again and the outcome is attached, with the same incident id.

Repeats and recovery

  • Attach identity: the Opsgenie alert id. A Create for an alert whose room is still open attaches to it and writes nothing.
  • Fires again later: a Create for an alert whose room is no longer open opens a new room.
  • Acknowledge: recorded on the alert's room. One for an alert that never opened a room is accepted and recorded in the audit log as opsgenie.action.ignored.
  • Maintenance windows: a Create that matches an active maintenance window opens no room.
  • Recovery: a Close is recorded as opsgenie.alert.closed and the room stays open until a person closes it.

Troubleshooting

What you seeWhat it means
401The header is missing, or its value is not the latest secret. Issuing a secret again replaces the old one, so paste the new value into Opsgenie.
202 with ignoredAn action Landfall does not act on, a body without alert.alertId, or an Acknowledge or Close for an alert that never opened a room.
202 with attachedThe alert's room is still open; nothing new was written.
400The body is not valid JSON. It is refused before the secret is checked.
429More than 60 deliveries a minute came from one address.
503Landfall could not open the room or record the action. Opsgenie retries it.
Why every delivery gets a 202, even ones Landfall ignores

Opsgenie retries a non-2xx delivery with backoff and eventually disables the webhook. Landfall answers 202 to every authenticated delivery, including an action it does not act on, so an odd payload never turns into an endless retry loop. The one exception is 503, where a retry is the right answer.

Reference

FieldValue
EndpointPOST https://api.landfalls.ai/triggers/opsgenie
AuthA per-organization shared secret in the x-landfall-opsgenie-secret header. Landfall stores only its SHA-256 hash.
Issue or rotatePOST /o/<your-org-slug>/triggers/opsgenie-secret, admin only. Shown once; issuing again replaces it immediately.
Recognized byaction and alert.alertId.
Attach identityThe Opsgenie alert id (alert.alertId).
Each delivery202 with outcome opened, attached, recorded, ignored or suppressed.
Rejected payloads401, identical for every secret problem; 400 for a body that is not JSON; a body over 512 KB is refused; 429 above 60 a minute from one address; 503 for a failure on Landfall's side.
Incident badgeOpsgenie

See Integrations architecture for how every trigger source shares one pipeline.