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

# Merge incidents

`PUT https://api.pagerduty.com/incidents/{id}/merge`

Merge a list of source incidents into the target [incident](https://docs.pagerduty.com/developer/api-concepts#incidents).

After the merge is performed the target incident will contain the source incidents' [alerts](https://docs.pagerduty.com/developer/api-concepts#alerts),
and the source incidents will be resolved.

Only incidents that have alerts or incidents that were created manually in the UI can be merged.

Open incidents cannot be merged into a resolved incident. The target incident must be open.

An incident cannot have more than 1000 alerts. The server will return an error if merging the source incidents
will result in the target incident having more than 1000 alerts.

Scoped OAuth requires: `incidents.write`

## Authorization

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

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | The ID of the resource. |

## 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) | yes | The email address of a valid user associated with the account making the request. |

## Request body (`application/json`)

| Field | Type | Required | Description |
|---|---|---|---|
| `source_incidents` | array of object | yes | The source incidents that will be merged into the target incident and resolved. |
| `source_incidents[].id` | string | yes | Read-only. |
| `source_incidents[].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. |
| `source_incidents[].type` | string | yes | One of: `incident_reference`. |
| `source_incidents[].self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `source_incidents[].html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |

Example: Request Example

```json
{
  "source_incidents": [
    {
      "id": "P8JOGX7",
      "type": "incident_reference"
    },
    {
      "id": "PPVZH9X",
      "type": "incident_reference"
    }
  ]
}
```

## Response 200

The target incident, which now contains all the alerts from the source incident.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `incident` | object | yes |  |
| `incident.id` | string | yes | Read-only. |
| `incident.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.type` | string | yes | One of: `incident_reference`. |
| `incident.self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `incident.html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |

Example: Response Example

```json
{
  "incident": {
    "id": "PT4KHLK",
    "type": "incident_reference",
    "summary": "[#1234] The server is on fire.",
    "self": "https://api.pagerduty.com/incidents/PT4KHLK",
    "html_url": "https://subdomain.pagerduty.com/incidents/PT4KHLK"
  }
}
```

## 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 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 404

The requested resource was not found.

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