> ## 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. PagerDuty authenticates with a **User API Token** scoped to the creating user's permissions.

***

## Supported platforms

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

***

## Prerequisites

* A **PagerDuty account** on any plan.
* A **User API Token** from **My Profile → User Settings → API Access**.

<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>

***

## 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 the connection in CloudThinker">
    Navigate to **Connections → PagerDuty** and enter:

    * **User API Key**: the token you just generated

    Click **Connect**. CloudThinker verifies the credentials and shows a **Connected** status.
  </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>

***

## 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

<Tip>
  Follow least privilege: assign Observer role for read-only monitoring. Promote to Responder or Manager only when incident write actions are needed.
</Tip>

***

## Agent capabilities

Once connected, agents can query and act on PagerDuty data.

| 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                    |

### Verify the connection

```text theme={null}
@alex list all triggered PagerDuty incidents and report the current on-call schedule
```

### Example prompts

```text theme={null}
@alex list all triggered and acknowledged incidents and #report any patterns by service
@alex who is currently on-call for the platform-engineering service?
@alex show next week's on-call schedule and identify any coverage gaps
```

***

## Troubleshooting

<Accordion title="Authentication failed">
  The token is incorrect, expired, or revoked. Verify the User API Token, ensure you are using a **User Token** (not a REST API Key), and generate a new token if needed.
</Accordion>

<Accordion title="Permission denied">
  The user has insufficient role permissions or team-level access restrictions. For write operations, ensure the user has Responder or Manager role.
</Accordion>

<Accordion title="Missing services or incidents">
  The user does not have access to the relevant teams. Verify team membership includes the services you want to monitor.
</Accordion>

<Accordion title="Token revoked">
  Navigate to **My Profile → User Settings** in PagerDuty, create a new API User Token, and update the token in CloudThinker connection settings.
</Accordion>

***

## Security

* **Least privilege** — grant only the permissions the agents need for your use case; start read-only and widen later.
* **Read-only by default** — use read-only credentials unless you want agents to make changes through this connection.
* **Rotate credentials** — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
* **Revoke on offboarding** — remove the credential at the provider when you delete a connection or a teammate leaves.

- **User token** — use a User API Token scoped to a dedicated PagerDuty user rather than a General Access REST API Key.
- **Team scoping** — limit the dedicated user's team membership to only the services CloudThinker needs to monitor.

***

## 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>
