# Retrieving Datadog API Key

To integrate with **Datadog**, Pagerly requires **both of the following keys**:

***

### ✅ Required Keys

#### 1. API Key (Required)

* Used for:
  * Authenticating requests
  * Basic data access

***

#### 2. Application Key (Required)

* Used for:
  * Accessing sensitive resources like:
    * On-call schedules
    * Users
    * Rotations
* This is **mandatory** for on-call APIs

***

### 📌 Summary

👉 For Pagerly to work fully with Datadog, we need:

* **API Key + Application Key**
* With **Read access to On-call & Users**
* (Write access optional — only if you plan to modify schedules later)

***

### 🔑 How to Generate API Key

<figure><img src="/files/RA0h3ZQpd6cLKPqrw6ZG" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/ZBuXBUgNrvgw343lKcz0" alt=""><figcaption></figcaption></figure>

####

#### Step-by-step:

1. Go to Datadog
2. Navigate to:\
   👉 **Organization Settings → API Keys**
3. Click **“New API Key”**
4. Give it a name (e.g., `pagerly-integration`)
5. Copy the generated key

***

### 🔑 How to Generate Application Key

#### Step-by-step:

1. Go to:\
   👉 **Organization Settings → Application Keys**
2. Click **“New Application Key”**
3. Select:
   * **Scoped Application Key** (recommended)
4. Assign permissions:
   * ✅ `on_call_read`
   * ✅ `users_read`
   * (Optional) `on_call_write`
5. Generate and copy the key

***

### ⚙️ Permission Levels (Datadog)

Unlike PagerDuty, Datadog uses:

#### 1. API Key

* No granular permissions
* Used for authentication

#### 2. Application Key

* Scoped permissions (fine-grained)
* Controls access to:
  * On-call schedules
  * Users
  * Teams

***

### 🚀 Next Step

👉 Now that keys are ready:

* Add **API Key + App Key** in Pagerly
* Configure **Schedule ID**
* Create Team

***

### 🔥 Important Notes

* Keys are tied to a **Datadog site**:
  * `datadoghq.com` (US)
  * `datadoghq.eu` (EU)
  * etc.
* Make sure:
  * Keys and API calls use the same site
* Store keys securely (they provide full account access)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pagerly.io/oncall-and-rotations/sync-schedule-from-tools-pagerduty-opsgenie-etc/retrieving-datadog-api-key.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
