Merge Incidents
Merges one Incident Management incident into another: its alerts and timeline move over, and the merged incident stops escalating.
POST /api/im/incidents/:id/merge
Merges the incident :id (the source) into targetIncidentId, for example when two alerts turned out to be the same outage. In one step:
- all alerts and timeline events of the source move to the target,
- the source gets status
mergedandmergedIntoIdset to the target, and its escalation stops, - the source's timeline records
merged, the target's recordsmerge_received.
Role assignments stay on the source. A merge cannot be undone through the API.
Authentication
Any IM-eligible role (admin, editor, responder) or an organization-wide API token, see Authentication. Incident Management must be enabled for the organization.
Restricted to the source incident's team: you must be a member of the team of incident :id or an organization admin. An organization-wide API token passes as an organization admin.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
targetIncidentId | number | Yes | The incident to merge into. Must belong to the same organization, and must be neither merged nor resolved. |
Example (cURL)
curl -X POST "$BASE_URL/api/im/incidents/43/merge" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "targetIncidentId": 42 }'Response
200 OK: the updated source incident row (same shape as the items of List Incidents, without the enrichment fields) and the target ID.
{
"source": {
"id": 43,
"teamId": 3,
"title": "Replica lag above threshold",
"status": "merged",
"mergedIntoId": 42,
"currentTier": null,
"escalationEpoch": 1
},
"targetIncidentId": 42
}(source shortened; the full row is returned.)
Common errors
401 Unauthorizedwhen not authenticated403 Forbidden(customerScopedTokenForbidden) when using a customer-scoped token403 Forbidden(imAccessDenied) when the session user has no IM-eligible role403 Forbidden(imNotEnabled) when Incident Management is not enabled for the organization403 Forbidden(imTeamMembershipRequired) when you are neither a member of the source incident's team nor an organization admin400 Bad Request(invalidRequestBody) when:idis not a positive integer, ortargetIncidentIdis missing or not a positive integer404 Not Found(imIncidentNotFound) when the source or the target incident does not exist, or belongs to another organization422 Unprocessable Entity(imIncidentCannotMergeIntoSelf) whentargetIncidentIdequals:id422 Unprocessable Entity(imIncidentAlreadyMerged) when the source incident is alreadymerged422 Unprocessable Entity(imIncidentTargetAlreadyMerged) when the target incident ismerged422 Unprocessable Entity(imMergeTargetClosed) when the target incident isresolved