> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudthinker.io/llms.txt
> Use this file to discover all available pages before exploring further.

# PagerDuty

> Connect PagerDuty to CloudThinker for on-call management, incident alerting, and escalation policy integration

Connect your PagerDuty account to enable CloudThinker agents to manage incidents, view on-call schedules, monitor services, and handle escalation policies.

***

## Supported Platforms

| Platform      | Support                                                      |
| ------------- | ------------------------------------------------------------ |
| **PagerDuty** | All plans (Free, Professional, Business, Digital Operations) |

***

## Setup

<Steps>
  <Step title="Open PagerDuty">
    Sign in to your PagerDuty account at [app.pagerduty.com](https://app.pagerduty.com).
  </Step>

  <Step title="Generate a User API Key">
    Click your **User Icon → My Profile**, then scroll to **User Settings → API Access** and click **Create API User Token**:

    * **Description**: `cloudthinker`
    * Click **Create Key**

    Copy the key immediately — it will not be shown again.
  </Step>

  <Step title="Add Connection in CloudThinker">
    Navigate to **Connections → PagerDuty** and enter:

    * **User API Key**: The token you just generated
  </Step>
</Steps>

<Warning>
  Copy the API token immediately after creation. PagerDuty will not show it again, and you'll need to create a new token if lost.
</Warning>

<Info>
  Use a **User API Token**, not a General Access REST API Key. User tokens scope access to what the user can see, providing better security boundaries.
</Info>

***

## Connection Details

| Field                         | Description              | Example      |
| ----------------------------- | ------------------------ | ------------ |
| **PAGERDUTY\_USER\_API\_KEY** | PagerDuty User API Token | `u+xxxxx...` |

***

## Required Permissions

### Minimum (Read-Only)

A user with **Observer** or **Responder** role provides:

* View incidents, services, and escalation policies
* View on-call schedules
* View teams and users

### Recommended (Full Operations)

A user with **Responder** or **Manager** role provides:

* All read permissions
* Acknowledge and resolve incidents
* Create incidents and status updates
* Manage on-call overrides

***

## Agent Capabilities

Once connected, agents can:

| Capability              | Description                                                  |
| ----------------------- | ------------------------------------------------------------ |
| **Incident Triage**     | List triggered and acknowledged incidents, identify patterns |
| **On-Call Schedules**   | View who is currently on-call and upcoming rotations         |
| **Service Health**      | Monitor service status and active incident counts            |
| **Escalation Policies** | View escalation chains and notification rules                |
| **Incident Actions**    | Acknowledge, resolve, and add notes to incidents             |
| **Schedule Management** | View schedules and identify coverage gaps                    |

### Example Prompts

```bash theme={null}
@alex list all triggered and acknowledged incidents and identify patterns
@alex who is currently on-call for the platform-engineering service?
@alex list all services with active incidents and their current status
@alex show next week's on-call schedule and identify any coverage gaps
```

***

## Troubleshooting

<Accordion title="Authentication failed">
  * Verify the User API Token is correct
  * Check the token has not been revoked
  * Ensure you are using a **User Token**, not a REST API Key
</Accordion>

<Accordion title="Permission denied">
  * Verify the user has sufficient role permissions
  * Check team-level access restrictions
  * For write operations: ensure the user has Responder or Manager role
</Accordion>

<Accordion title="Missing services or incidents">
  * Verify the user has access to the relevant teams
  * Check team membership includes the services you want to monitor
  * Ensure incidents are not filtered by team scope
</Accordion>

<Accordion title="Token revoked">
  * Navigate to **My Profile → User Settings** in PagerDuty
  * Create a new API User Token
  * Update the token in CloudThinker connection settings
</Accordion>

***

## Security Best Practices

* **User token** - Use a User API Token scoped to a dedicated user
* **Minimal role** - Assign Observer role for read-only use cases
* **Dedicated user** - Create a dedicated PagerDuty user for CloudThinker
* **Token rotation** - Rotate tokens every 90 days
* **Team scoping** - Limit user team membership to only the teams CloudThinker needs access to

***

## Related

<CardGroup cols={2}>
  <Card title="ServiceNow Connection" icon="https://mintcdn.com/cloudthinker/aLd-ttc-SCW-aFky/images/icons/servicenow.svg?fit=max&auto=format&n=aLd-ttc-SCW-aFky&q=85&s=3fee0d3d5346b20beb018bcf854e968e" href="/guide/connections/servicenow" width="24" height="24" data-path="images/icons/servicenow.svg">
    ITSM incident management
  </Card>

  <Card title="Datadog Connection" icon="https://mintcdn.com/cloudthinker/aLd-ttc-SCW-aFky/images/icons/datadog.svg?fit=max&auto=format&n=aLd-ttc-SCW-aFky&q=85&s=e8382167f2a1eb1e00971b5f4d703d48" href="/guide/connections/datadog" width="24" height="24" data-path="images/icons/datadog.svg">
    Observability and monitoring
  </Card>
</CardGroup>
