# Webhooks (Datadog)

## Overview

In this tutorial, we’ll set up Datadog to send notifications to a Group Chat.
Although this tutorial is specific to Datadog, the general approach should apply widely.

Setup requires the following steps:

1. Create an API Key.
2. Find the ID of your Roam and the Group you want to notify.
3. Set up the Webhook in Datadog to authenticate with the key and send to the group.
4. Set up a Monitor with the notification conditions and message format.

## Create an API key

Create an API key in _Roam Administration_.
See the Quick Start for more detail.

## Find the Roam & Group IDs

In Roam Administration, click on Roam. Your Roam ID is displayed at the
top of the page, next to your Roam name.

Use the `List Groups` API endpoint to browse public groups and find the ID of the
group you wish to notify. Using your API key, run the following command:

```bash
$ curl -H "Authorization: Bearer $API_KEY" https://api.ro.am/v1/groups.list
```

Look for the desired group in the output to find the associated ID.

## Set up a Webhook in Datadog

1.  Navigate to _Integrations_ in the web console and select Webhooks to install
    and configure it.

2.  Create a _New Variable_ for your API Key named `API_KEY`.

3.  Name your Webhook and set the URL to [https://api.ro.am/v1/chat.sendMessage](/docs/roam-api/send-message)

4.  Set the Payload to the following, using the Group ID from the last step:

```
        {
            "text": "$EVENT_MSG",
            "sender": {"name": "Datadog", "id": "datadog"},
            "recipients": ["4ff757dd-4954-42d4-b13d-f0dac34d6f7d"]
        }
```

5.  Set _Custom Headers_ to the following:

```
        { "Authorization": "Bearer $API_KEY" }
```

6.  Save the Webhook.

## Set up a Monitor in Datadog

1. Navigate to Monitors > New Monitor and select a type corresponding to the
   event for which you want to notify.

2. Configure the notification conditions and compose a notification message.

3. In “Notify your services and your team members”, select `webhook-NAME` to
   deliver notifications using the webhook.

4. Save your monitor and click “Test Notifications” to open a dialog allowing
   you to send webhooks on demand. This is the best way to confirm that
   everything works and iterate on the notification content.