> Documentation index for AI agents: https://docs.pagerduty.com/llms.txt

# Create an Incident Workflow

`POST https://api.pagerduty.com/incident_workflows`

Create a new Incident Workflow

An Incident Workflow is a sequence of configurable Steps and associated Triggers that can execute automated Actions for a given Incident.

Scoped OAuth requires: `incident_workflows.write`

## Authorization

- **api_key** (apiKey) — `Authorization` header. The API Key with format `Token token=<API_KEY>`

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Accept` | string | yes | The `Accept` header is used as a versioning header. Default: `application/vnd.pagerduty+json;version=2`. |

## Request body (`application/json`)

| Field | Type | Required | Description |
|---|---|---|---|
| `incident_workflow` | object | yes |  |
| `incident_workflow.id` | string |  | Read-only. |
| `incident_workflow.summary` | string \| null |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `incident_workflow.type` | string |  | One of: `incident_workflow`. |
| `incident_workflow.self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `incident_workflow.html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `incident_workflow.name` | string |  | A descriptive name for the Incident Workflow. |
| `incident_workflow.description` | string |  | A description of what the Incident Workflow does. |
| `incident_workflow.created_at` | string (date-time) |  | The timestamp this Incident Workflow was created. Read-only. |
| `incident_workflow.team` | object |  | If specified then workflow edit permissions will be scoped to members of this team. |
| `incident_workflow.team.type` | string |  | Type of the referenced object. Read-only. One of: `team_reference`. |
| `incident_workflow.team.id` | string |  | Unique identifier for the resource. Read-only. |
| `incident_workflow.is_enabled` | boolean |  | Indicates whether the Incident Workflow is enabled or not. Disabled workflows will not be triggered, and will not count toward the account's enabled workflow limit. Default: `true`. |
| `incident_workflow.steps` | array of object |  | The ordered list of steps that execute sequentially as part of the workflow. |
| `incident_workflow.steps[].id` | string |  | Read-only. |
| `incident_workflow.steps[].summary` | string \| null |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `incident_workflow.steps[].type` | string |  | One of: `step`. |
| `incident_workflow.steps[].self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `incident_workflow.steps[].html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `incident_workflow.steps[].name` | string | yes | A descriptive name for the Step. |
| `incident_workflow.steps[].description` | string |  | A description of the action performed by the Step. Read-only. |
| `incident_workflow.steps[].action_configuration` | object | yes | Configuration of automated action executed by this Step. |
| `incident_workflow.steps[].action_configuration.action_id` | string | yes | The identifier of the Action to execute. |
| `incident_workflow.steps[].action_configuration.description` | string |  | Description of the Action. Read-only. |
| `incident_workflow.steps[].action_configuration.inputs` | array of object | yes | An unordered list of standard inputs used to configure the Action to execute. |
| `incident_workflow.steps[].action_configuration.inputs[].name` | string | yes | The name for this Input. Input names are unique per action and should be used to find a specific Input. |
| `incident_workflow.steps[].action_configuration.inputs[].parameter_type` | string |  | The data type of this Input. Read-only. |
| `incident_workflow.steps[].action_configuration.inputs[].value` | string | yes | The configured value of the Input. |
| `incident_workflow.steps[].action_configuration.inline_steps_inputs` | array of object |  | An unordered list of specialized inputs used to configure a workflow-within-a-workflow. |
| `incident_workflow.steps[].action_configuration.inline_steps_inputs[].name` | string | yes | The name for this Input. Input names are unique per action and should be used to find a specific Input. |
| `incident_workflow.steps[].action_configuration.inline_steps_inputs[].value` | object | yes | The configured value of the Inline Steps Input. |
| `incident_workflow.steps[].action_configuration.inline_steps_inputs[].value.steps` | array of object |  |  |
| `incident_workflow.steps[].action_configuration.outputs` | array of object |  | An unordered list of outputs this action produces. Read-only. |
| `incident_workflow.steps[].action_configuration.outputs[].name` | string | yes | The name for this Output. Output names are unique per action and should be used to find a specific Output. Read-only. |
| `incident_workflow.steps[].action_configuration.outputs[].reference_name` | string |  | The reference name of the Output. Read-only. |
| `incident_workflow.steps[].action_configuration.outputs[].parameter_type` | string |  | The data type produced by this Output. Read-only. |

Example: Request Example

```json
{
  "incident_workflow": {
    "name": "Example Incident Workflow",
    "description": "This Incident Workflow is an example",
    "steps": [
      {
        "name": "Send Status Update",
        "action_configuration": {
          "action_id": "pagerduty.com:incident-workflows:send-status-update:1",
          "inputs": [
            {
              "name": "Message",
              "value": "Example status message sent on {{current_date}}"
            }
          ]
        }
      }
    ]
  }
}
```

## Response 201

The new Incident Workflow

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `incident_workflow` | object | yes | Same fields as `incident_workflow` above. |

Example: Response Example

```json
{
  "incident_workflow": {
    "id": "PSFEVL7",
    "name": "Example Incident Workflow",
    "description": "This Incident Workflow is an example",
    "type": "incident_workflow",
    "created_at": "2022-12-13T19:55:01.171Z",
    "self": "https://api.pagerduty.com/incident_workflows/PSFEVL7",
    "html_url": "https://pdt-flex-actions.pagerduty.com/flex-workflows/workflows/PSFEVL7",
    "steps": [
      {
        "id": "P4RG7YW",
        "type": "step",
        "name": "Send Status Update",
        "description": "Posts a status update to a given incident",
        "action_configuration": {
          "action_id": "pagerduty.com:incident-workflows:send-status-update:1",
          "description": "Posts a status update to a given incident",
          "inputs": [
            {
              "name": "Message",
              "parameter_type": "text",
              "value": "Example status message sent on {{current_date}}"
            }
          ],
          "outputs": [
            {
              "name": "Result",
              "reference_name": "result",
              "parameter_type": "text"
            },
            {
              "name": "Result Summary",
              "reference_name": "result-summary",
              "parameter_type": "text"
            },
            {
              "name": "Error",
              "reference_name": "error",
              "parameter_type": "text"
            }
          ]
        }
      }
    ]
  }
}
```

## Response 400

Caller provided invalid arguments. Please review the response for error details. Retrying with the same arguments will *not* work.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 401

Caller did not supply credentials or did not provide the correct credentials.
If you are using an API key, it may be invalid or your Authorization header may be malformed.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 402

Account does not have the abilities to perform the action. Please review the response for the required abilities.
You can also use the [Abilities API](#resource_Abilities) to determine what features are available to your account.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 403

Caller is not authorized to view the requested resource.
While your authentication is valid, the authenticated user or token does not have permission to perform this action.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 429

Too many requests have been made, the rate limit has been reached.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Developer Agreement

Your access to and use of the PagerDuty Developer Services is governed by the [PagerDuty Developer Agreement](https://docs.pagerduty.com/developer/pagerduty-developer-agreement).
