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

# Create an escalation policy

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

Creates a new escalation policy. At least one escalation rule must be provided.

Escalation policies define which user should be alerted at which time.

For more information see the [API Concepts Document](https://docs.pagerduty.com/developer/api-concepts#escalation-policies)

Scoped OAuth requires: `escalation_policies.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`. |
| `From` | string (email) |  | The email address of a valid user associated with the account making the request. This is optional, and is only used for change tracking. |

## Request body (`application/json`)

The escalation policy to be created.

| Field | Type | Required | Description |
|---|---|---|---|
| `escalation_policy` | object | yes |  |
| `escalation_policy.id` | string |  | Read-only. |
| `escalation_policy.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. |
| `escalation_policy.type` | string | yes | The type of object being created. One of: `escalation_policy`. Default: `escalation_policy`. |
| `escalation_policy.self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `escalation_policy.html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `escalation_policy.name` | string | yes | The name of the escalation policy. |
| `escalation_policy.description` | string |  | Escalation policy description. |
| `escalation_policy.num_loops` | integer |  | The number of times the escalation policy will repeat after reaching the end of its escalation. Default: `0`. Minimum: 0. |
| `escalation_policy.on_call_handoff_notifications` | string |  | Determines how on call handoff notifications will be sent for users on the escalation policy. Defaults to "if_has_services". One of: `if_has_services`, `always`. |
| `escalation_policy.escalation_rules` | array of object | yes |  |
| `escalation_policy.escalation_rules[].id` | string |  | Read-only. |
| `escalation_policy.escalation_rules[].escalation_delay_in_minutes` | integer | yes | The number of minutes before an unacknowledged incident escalates away from this rule. |
| `escalation_policy.escalation_rules[].targets` | array of object | yes | The targets an incident should be assigned to upon reaching this rule. Min items: 1. Max items: 10. |
| `escalation_policy.escalation_rules[].targets[].id` | string | yes | Read-only. |
| `escalation_policy.escalation_rules[].targets[].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. |
| `escalation_policy.escalation_rules[].targets[].type` | string | yes | One of: `user`, `schedule`, `user_reference`, `schedule_reference`, `schedule_v3_reference`. |
| `escalation_policy.escalation_rules[].targets[].self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `escalation_policy.escalation_rules[].targets[].html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `escalation_policy.escalation_rules[].escalation_rule_assignment_strategy` | string |  | The strategy used to assign the escalation rule to an incident. One of: `round_robin`, `assign_to_everyone`. |
| `escalation_policy.services` | array of object |  | Read-only. Min length: 0. |
| `escalation_policy.services[].id` | string | yes | Read-only. |
| `escalation_policy.services[].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. |
| `escalation_policy.services[].type` | string | yes | One of: `service_reference`. |
| `escalation_policy.services[].self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `escalation_policy.services[].html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `escalation_policy.teams` | array of object |  | Team associated with the policy. Account must have the `teams` ability to use this parameter. Only one team may be associated with the policy. Min length: 0. |
| `escalation_policy.teams[].id` | string | yes | Read-only. |
| `escalation_policy.teams[].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. |
| `escalation_policy.teams[].type` | string | yes | One of: `team_reference`. |
| `escalation_policy.teams[].self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `escalation_policy.teams[].html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |

Example: Request Example

```json
{
  "escalation_policy": {
    "type": "escalation_policy",
    "name": "Engineering Escalation Policy",
    "escalation_rules": [
      {
        "escalation_delay_in_minutes": 30,
        "targets": [
          {
            "id": "PEYSGVF",
            "type": "user_reference"
          }
        ],
        "escalation_rule_assignment_strategy": {
          "type": "round_robin"
        }
      }
    ],
    "services": [
      {
        "id": "PIJ90N7",
        "type": "service_reference"
      }
    ],
    "num_loops": 2,
    "on_call_handoff_notifications": "if_has_services",
    "teams": [
      {
        "id": "PQ9K7I8",
        "type": "team_reference"
      }
    ],
    "description": "Here is the ep for the engineering team."
  }
}
```

## Response 201

The escalation policy that was created.

### `application/json`

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

Example: Response Example

```json
{
  "escalation_policy": {
    "id": "PT20YPA",
    "type": "escalation_policy",
    "summary": "Engineering Escalation Policy",
    "on_call_handoff_notifications": "if_has_services",
    "self": "https://api.pagerduty.com/escalation_policies/PT20YPA",
    "html_url": "https://subdomain.pagerduty.com/escalation_policies/PT20YPA",
    "name": "Engineering Escalation Policy",
    "escalation_rules": [
      {
        "id": "PT20YPA",
        "escalation_delay_in_minutes": 22,
        "targets": [
          {
            "id": "PXPGF42",
            "summary": "Earline Greenholt",
            "type": "user_reference",
            "self": "https://api.pagerduty.com/users/PXPGF42",
            "html_url": "https://subdomain.pagerduty.com/users/PXPGF42"
          },
          {
            "id": "PI7DH85",
            "summary": "Daily Engineering Rotation",
            "type": "schedule_reference",
            "self": "https://api.pagerduty.com/schedules/PI7DH85",
            "html_url": "https://subdomain.pagerduty.com/schedules/PI7DH85"
          }
        ]
      }
    ],
    "services": [
      {
        "id": "PIJ90N7",
        "type": "service_reference",
        "summary": "My Mail Service",
        "self": "https://api.pagerduty.com/services/PIJ90N7",
        "html_url": "https://subdomain.pagerduty.com/service-directory/PIJ90N7"
      }
    ],
    "num_loops": 2,
    "teams": [
      {
        "id": "PQ9K7I8",
        "type": "team_reference",
        "summary": "Engineering",
        "self": "https://api.pagerduty.com/teams/PQ9K7I8",
        "html_url": "https://subdomain.pagerduty.com/teams/PQ9K7I8"
      }
    ]
  }
}
```

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