Send a Webhook to Opsgenie: Transform & Forward Any Payload

Send any webhook to Opsgenie. Transform an incoming webhook into the Opsgenie API format in flight and forward it — no glue server, no code to maintain.

Send a Webhook to Opsgenie: Transform & Forward Any Payload

You have a service that fires webhooks — a form, a payment provider, a CI pipeline, a monitoring tool — and you want each event to open an alert in Opsgenie. The problem: the Opsgenie API won't accept the raw webhook. It expects its own JSON shape and authentication, and the payload your source sends never matches.

Webhook Relay sits in the middle. It receives the incoming webhook at a stable public URL, transforms the payload into the format Opsgenie expects, and delivers it — no glue server, no Lambda, no maintenance.

How it works

  1. Your source service POSTs its webhook to a Webhook Relay endpoint.
  2. A transformation function parses the payload and builds a Opsgenie API request.
  3. Webhook Relay forwards it to Opsgenie, and the record is created.

Step 1: Get your Opsgenie credentials

You need an API key from an Opsgenie API integration (use api.eu.opsgenie.com on the EU instance).

Step 2: Create a Webhook Relay output to the Opsgenie API

Create a bucket with a public input, then add an output pointing at the Opsgenie API:

  • Output destination: https://api.opsgenie.com/v2/alerts
  • Headers:
    • Authorization: GenieKey <your-api-key>
    • Content-Type: application/json

Step 3: Add a transformation function

Attach a function that reshapes the incoming webhook. Opsgenie's Alert API expects a message (required), plus optional description, priority (P1P5) and an alias for deduplication.

-- incoming payload is in r.RequestBody
local body = json.decode(r.RequestBody)

local alert = {
  message = body.title or "Alert from webhook",
  description = body.message or r.RequestBody,
  alias = body.id,                 -- stable alias so repeats update one alert
  priority = body.priority or "P3"
}

r:SetRequestBody(json.encode(alert))

Step 4: Point your source at the URL and test

Configure your source service's webhook to point at the Webhook Relay public URL. Trigger an event — or replay one from the Webhook Bin — and the record appears in Opsgenie within seconds. If the API rejects the request, the Webhook Relay logs show Opsgenie's exact error so you can fix the mapping.

Going further

Get started

Create a free Webhook Relay account and turn any webhook into Opsgenie records — no servers to run. New to webhooks? Start with what is a webhook and how to transform webhooks.