# Connector configuration

The PagerDuty connector has two paths. Select one when you create the connector.

| Path               | Credential                                       | Sync                             | Sends            | Use it for                                                                                      |
| ------------------ | ------------------------------------------------ | -------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------- |
| **Service key**    | Service integration key entered on the connector | One-way (Coralogix to PagerDuty) | Alerts and Cases | Routing notifications to a single PagerDuty service                                             |
| **Bi-directional** | Account-level PagerDuty integration              | Two-way (Cases ↔ PagerDuty)      | Cases only       | Keeping Cases and incidents in sync across acknowledge, resolve, comments, and resolution notes |

The connector path stays fixed after you create it. For what two-way sync covers and how to set up the account-level integration, see the \[PagerDuty Bi-directional integration\](https://coralogix.com/docs/user-guides/notification-center/destination-types/pagerduty/connector-config/{{ config.site_url }}integrations/pull/pagerduty/index.md).

The service-key path sends notifications one way to a single PagerDuty service.

| UI label                | API field name          | Type     | Required | Allows notification source type overrides | Description                                                                                                                                                                                                        |
| ----------------------- | ----------------------- | -------- | -------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Service key**         | `integrationKey`        | `String` | true     | true                                      | Also known as an [Integration Key](https://support.pagerduty.com/main/docs/services-and-integrations#generate-a-new-integration-key), this unique identifier routes notifications to a specific PagerDuty service. |
| **Dynamic service key** | `dynamicintegrationKey` | `String` | false    | true                                      | Specify a dynamic, data-driven value for the service key using alert metadata. Useful if you need to route alerts to different PagerDuty services based on different conditions.                                   |

### Templating for dynamic routing

The **Service key** field supports [dynamic templating](https://coralogix.com/docs/user-guides/notification-center/dynamic-templating/index.md), which routes events to different PagerDuty services by inserting variables into the notification configuration based on their attributes.

Here is an example **Dynamic service key** configuration:

```js
{% if alert.groups['team_name'] == 'alpha'%}
  930aaaaaaaaaaaaaaaaaaaaaaaaaa0d1
{% elif alert.groups['team_name'] == 'beta' %}
  930bbbbbbbbbbbbbbbbbbbbbbbbbb0d1
{% else %}
  930xxxxxxxxxxxxxxxxxxxxxxxxxx0d1
{% endif %}
```

The bi-directional path keeps a Case and its linked PagerDuty incident in sync in both directions. It reads an account-level PagerDuty integration and applies to Cases only, not to alerts.

| Field                     | Description                                                                                                                                   |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **PagerDuty integration** | The account-level PagerDuty integration this connector uses for bi-directional sync. If none exists, the empty state links you to set one up. |
| **Service name**          | Select the PagerDuty service this connector targets.                                                                                          |
| **Dynamic service name**  | (Advanced, optional) Dynamically target a PagerDuty service using templating. When set, it overrides **Service name**.                        |

Before you select this path, add the account-level PagerDuty integration. For setup and the full sync behavior, see the \[PagerDuty Bi-directional integration\](https://coralogix.com/docs/user-guides/notification-center/destination-types/pagerduty/connector-config/{{ config.site_url }}integrations/pull/pagerduty/index.md).

## Next steps

Define the payload structure for PagerDuty notifications in [Message configuration](https://coralogix.com/docs/user-guides/notification-center/destination-types/pagerduty/schema-structure/index.md).
