---
title: "Send a Webhook to Datadog: Post Events From Any Source | WebhookRelay"
meta:
  "og:description": "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."
  "og:title": "Send a Webhook to Datadog: Post Events From Any Source"
  description: "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."
---

![Stripes](https://webhookrelay.com/blog/webhook-to-datadog/images/stripes.svg)

# **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](https://webhookrelay.com/blog/webhook-to-datadog/images/blog/heroes/route.jpg)

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](https://webhookrelay.com) 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](#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](#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](#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](#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](#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](https://webhookrelay.com/blog/webhook-to-datadog/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](#going-further)

- **Fan out:** also send the event to [PagerDuty](https://webhookrelay.com/blog/webhook-to-datadog/blog/webhook-to-pagerduty/), [Slack](https://webhookrelay.com/blog/webhook-to-datadog/blog/webhook-to-slack/) or archive it to [S3](https://webhookrelay.com/blog/webhook-to-datadog/blog/webhook-to-s3/) with [multiple destinations](https://webhookrelay.com/blog/webhook-to-datadog/features/webhook-multiple-destinations/).
- **Filter noise:** use [forwarding rules](https://webhookrelay.com/blog/webhook-to-datadog/features/forwarding-rules/) so only the events you care about reach Datadog.
- **Inspect first:** see the raw payload in the [Webhook Bin](https://webhookrelay.com/blog/webhook-to-datadog/webhook-bin/) before writing the mapping.

## [Get started](#get-started)

[Create a free Webhook Relay account](https://my.webhookrelay.com/register) and turn any webhook into Datadog events — no servers to run. New to webhooks? Start with [what is a webhook](https://webhookrelay.com/blog/webhook-to-datadog/blog/what-is-webhook/) and [how to transform webhooks](https://webhookrelay.com/blog/webhook-to-datadog/features/transform-webhooks/).