# 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="https://296040630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu15pukNExHWOsjYrdZrh%2Fuploads%2FYMQHgqe3uwAH0D88cRoF%2Fimage.png?alt=media&#x26;token=ddd52ff3-1fcb-47cc-b39b-7a8091e150a0" alt=""><figcaption></figcaption></figure>

<figure><img src="https://296040630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu15pukNExHWOsjYrdZrh%2Fuploads%2FTE4XjLsW47weACa5s3NK%2Fimage.png?alt=media&#x26;token=a7b6a809-ca15-43e0-84dd-856dad9068ff" 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)
