Send a Webhook to Datadog: Post Events From Any Source

Send any webhook to Datadog. Transform an incoming webhook into a Datadog Events API request in flight to post events, alerts and deploy markers — no glue server.

Send a Webhook to Datadog: Post Events From Any Source

You want events from across your stack — deploys, signups, failed payments, CI runs — to show up on your Datadog Events stream so you can overlay them on dashboards and alert on them. The problem: the Datadog Events API expects a specific JSON body and the API key in a header, and the webhook your source sends never matches that shape.

Webhook Relay sits in the middle. It receives the incoming webhook at a stable public URL, transforms the payload into the Datadog Events API format, 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 maps the payload into a Datadog Events API request.
  3. Webhook Relay forwards it to the Datadog Events API with your API key, and the event appears in Datadog.

Step 1: Get a Datadog API key

In Datadog, go to Organization Settings → API Keys and copy (or create) an API key.

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

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

  • Output destination: https://api.datadoghq.com/api/v1/events (use datadoghq.eu for the EU site)
  • Headers:
    • DD-API-KEY: <your-api-key>
    • Content-Type: application/json

Step 3: Add a transformation function

Attach a function that maps the incoming webhook into a Datadog event:

local body = json.decode(r.RequestBody)

local event = {
  title = body.title or "Event from webhook",
  text = body.message or r.RequestBody,
  alert_type = body.severity or "info",        -- info | warning | error | success
  tags = { "source:webhook-relay", "service:" .. (body.service or "unknown") }
}

r:SetRequestBody(json.encode(event))

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 it appears on your Datadog Events stream within seconds. The Webhook Relay logs show Datadog's response if the mapping needs tweaking.

Going further

Get started

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