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

# PagerDuty User Provisioning & Deprovisioning

> Automate PagerDuty user provisioning and deprovisioning from your HRIS. Klef creates, updates, and deactivates accounts when HR makes a change.

![](https://mintcdn.com/klef/sAyDk8rKeTiR0EkQ/images/connectors/pagerduty.svg?fit=max\&auto=format\&n=sAyDk8rKeTiR0EkQ\&q=85\&s=cd744b58f9acb187d0fef2cd40e38385)

# PagerDuty

## Connection

### Setup

Klef reaches your account through PagerDuty's REST API, with a general access API key that an admin or the account owner creates.

**Step 1**

In PagerDuty, go to **Integrations**, then **Developer Tools**, then **API Access Keys**, and choose **Create New API Key**.

**Step 2**

Describe the key as Klef's, leave **Read-only API Key** unchecked, and choose **Create Key**.

**Step 3**

Copy the key into Klef, with your account's service region and the email of an admin, whom PagerDuty records as adding the users Klef creates.

PagerDuty keeps no deactivated user, so a user Klef switches off is deleted. PagerDuty refuses to delete a user with open incidents unless the account reassigns them on offboarding.

#### Permissions

Managing team membership is optional, and needs a PagerDuty plan that includes teams.

### Settings

| Setting | Required | Description |
| - | - | - |
| Service region | Yes | The region your account is in. An EU account's address ends in .eu.pagerduty.com. |
| API key | Yes | A general access REST API key that is not read-only. |
| Requester email | Yes | Email of an admin in the account. PagerDuty records the users the connector adds as added by them. |

## pagerduty.user

### Fields

| Field | Type | Required | Description |
| - | - | - | - |
| `email` | string | Yes | Email address the user signs in with. The connector does not change it once the user exists. Never changed once the account exists. |
| `name` | string, up to 100 | Yes | Full name. |
| `role` | enum | | Base role. Defaults to Manager. The account owner's role is changed in PagerDuty. Values: `user` (Manager), `limited_user` (Responder), `observer` (Observer), `restricted_access` (Restricted access), `read_only_user` (Full stakeholder), `read_only_limited_user` (Limited stakeholder), `admin` (Global admin). |
| `jobTitle` | string | | Job title. |
| `timeZone` | string | | Time zone, such as America/New\_York. Without one, the account's time zone applies. |
| `teams` | entitlements | | Teams the user belongs to. A team written on its own takes the team role PagerDuty gives the base role this policy sets. One row grants one team. |
| `teams[].team` | string | Yes | Team ID. |
| `teams[].role` | enum | | Role on the team. Values: `observer` (Observer), `responder` (Responder), `manager` (Manager). |
| `status` | enum | | Whether the person can sign in, the account is kept switched off, or the account is gone. Values: `enabled` (Enabled), `removed` (Removed). |

### Default Account Matching Rules

When Klef [adopts](https://klef.ai/docs/adoption.md) an account that already exists in PagerDuty, it works out whose it is by trying these in order. A connection can override them.

| Account field | Worker field |
| - | - |
| `email` | `worker.business_email` |

## Examples

### PagerDuty responders

A PagerDuty responder for every engineer, deleted when they leave.

```hcl theme={null}
stage active {
  target pagerduty.user {
    email  = worker.business_email
    name   = worker.display_name
    role   = "limited_user"
    status = enabled
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.