# PagerDuty

Firefly integrates with PagerDuty to provide real-time notifications for critical infrastructure events, policy violations, and other important alerts. This integration enables teams to receive immediate notifications and manage incidents effectively through PagerDuty's incident management platform.

When integrating with PagerDuty, you have two primary methods:

* [Integration Key](#integration-key).
* [General Access REST API Key](#general-access-rest-api-key).

## Prerequisites

* A PagerDuty account with administrative access.
* Appropriate permissions to generate integration keys or API keys.
* A configured PagerDuty service for receiving notifications.

## Setup Procedure

### Integration Key (Recommended Method)

Use this method for optimal integration with a specific PagerDuty service.

1. Generate an Integration Key:
   * Visit the [PagerDuty documentation](https://support.pagerduty.com/docs/services-and-integrations#generate-a-new-integration-key).
   * Follow the instructions to generate a new integration key.
   * Copy the Integration Key.
2. In Firefly:
   * Click **Settings > Integrations**.
   * Click **Add New > PagerDuty**.
   * Enter a descriptive name in the **Nickname** field.
   * Select **Integration Key** from the Integration Type field.
   * Paste the Integration Key in the **Key** box.
   * Click **Next**.
   * Click **Done**.

### General Access REST API Key

Use this method to generate notifications for all services available in your PagerDuty account.

> **Note**: For optimal integration, we recommend using an Integration Key instead.

1. Generate a Read-Only REST API Key:
   * Visit the [PagerDuty documentation](https://support.pagerduty.com/docs/api-access-keys#generate-a-general-access-rest-api-key).
   * Follow the instructions to generate a general access REST API key.
   * Copy the API key.
2. In Firefly:
   * Click **Settings > Integrations**.
   * Click **Add New > PagerDuty**.
   * Enter a descriptive name in the **Nickname** field.
   * Select **General Access REST API Key** from the Integration Type field.
   * Paste the API key in the **Key** field.
   * Click **Next**.
   * Click **Done**.

## Features Enabled

* **Real-time Incident Creation**: Automatically create PagerDuty incidents for critical events.
* **Service-specific Routing**: Direct notifications to specific PagerDuty services.
* **Rich Incident Details**: Include comprehensive information in incident descriptions.
* **Automated Resolution**: Close incidents when issues are resolved in Firefly.
* **Priority Management**: Set appropriate incident priorities based on event severity.

> **Note:** In the integration settings page, use the notifcation test button to test the integration.


---

# 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.firefly.ai/integrations/notifications/pagerduty.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.
