---
title: Create a PagerDuty incident
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/pagerduty/pagerduty-incident-create
---

For prerequisites, see [PagerDuty incident actions](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/pagerduty/pagerduty-incident#prerequisites).

## Create a PagerDuty incident

The action identifier is `pagerduty.incident.create`.

Creates a new incident in PagerDuty with specified service, title, priority, and other optional attributes.

### Inputs

The following table describes all available input fields for this action.

| Input                | Type   | Description                                                                                                            | Example                                                                           |
| -------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| **token**            | String | **Required.** PagerDuty API token.                                                                                     | `${{ :secrets:pagerdutyApiToken }}`                                               |
| **type**             | String | **Required.** Must be `"incident"`.                                                                                    | `"Incident"`                                                                      |
| **title**            | String | **Required.** Incident title.                                                                                          | `"Test Incident"`                                                                 |
| **service**          | Map    | **Required.** Service reference object with `id` and `type` fields.                                                    | `{"id": "PV5L94Z", "type": "service_reference"}`                                  |
| **from**             | String | **Optional.** Required for account tokens, optional for user tokens. The email address of the user making the request. | `abc@example.com`                                                                 |
| **priority**         | Map    | **Optional.** Priority reference.                                                                                      | `{"id": "P53ZZH5", "type": "priority_reference"}`                                 |
| **urgency**          | String | **Optional.** Incident urgency.                                                                                        | `"low"`                                                                           |
| **body**             | Map    | **Optional.** Incident body with `type` and `details`.                                                                 | `{"type": "incident_body", "details": "Incident details here."}`                  |
| **incidentKey**      | String | **Optional.** Deduplication key.                                                                                       | `"1234-5678-919123"`                                                              |
| **assignments**      | List   | **Optional.** List of assignee objects.                                                                                | `[{"assignee": {"id": "P11223", "type": "user_reference"}}]`                      |
| **incidentType**     | String | **Optional.** Incident type name.                                                                                      | `{"name": "major_incident"}`                                                      |
| **escalationPolicy** | Map    | **Optional.** Escalation policy reference.                                                                             | `{"id": "PT20YPA", "type": "escalation_policy_reference"}`                        |
| **conferenceBridge** | Map    | **Optional.** Conference bridge details.                                                                               | `{"conference_number": "+1 1234567890", "conference_url": "https://someUrl.com"}` |
| **selectors**        | List   | **Optional.** JQ selectors to extract fields from the output.                                                          | `[{"name": "incidentId", "expression": ".responseBody | fromjson.incident.id"}]`  |

### Outputs

The following table describes all output fields returned by this action.

| Output           | Type    | Description                                                               |
| ---------------- | ------- | ------------------------------------------------------------------------- |
| **success**      | Boolean | `true` on success, `false` on failure.                                    |
| **response**     | Object  | The created incident object. Key fields: `id`, `type`, `title`, `status`. |
| **errorMessage** | String  | Error message on failure. `null` on success.                              |

### Example

The following example creates a new PagerDuty incident with a service, urgency, body, and escalation policy.

| Workflow example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: create-pagerduty-incident description: Create a new PagerDuty incident steps:   - name: create     type: action     action: pagerduty.incident.create     version: 1     inputs:       token: ${{ :secrets:pagerdutyApiToken }}       type: incident       title: Test incident       service:         id: P123456         type: service_reference       urgency: low       body:         type: incident_body         details: Test Body       incidentKey: a12345-b678910-c111213       escalationPolicy:         id: P54321         type: escalation_policy_reference       selectors:         - name: incidentId           expression: .responseBody | fromjson.incident.id     next: end ``` |
