Namespace: microsoft.graph.security
Important
APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Merge multiple incident resources into a single incident.
This API is available in the following national cloud deployments.
| Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
| ✅ |
✅ |
✅ |
❌ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
| Permission type |
Least privileged permissions |
Higher privileged permissions |
| Delegated (work or school account) |
SecurityData.Manage.All |
Not available. |
| Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
| Application |
SecurityData.Manage.All |
Not available. |
Important
For delegated access using work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role that grants the permissions required for this operation. This operation supports the following built-in roles, which provide only the least privilege necessary:
- Security Operator. Can manage alerts and view, investigate, and respond to security alerts in the Microsoft 365 Defender portal. This is the least privileged role for this operation.
- Security Administrator. Has permissions to manage security-related features in the Microsoft 365 Defender portal, including managing security threats and alerts.
HTTP request
POST /security/incidents/mergeIncidents
Request body
In the request body, provide a JSON object with the following parameters.
| Parameter |
Type |
Description |
| incidentIds |
String collection |
Required. The IDs of the incidents to merge. |
| incidentComment |
String |
Optional. A comment to add to the merged incident. |
| mergeReasons |
microsoft.graph.security.correlationReason |
Optional. The correlation reasons for merging the incidents. This object is a flags enum that allows multiple values to be specified. |
Response
If successful, this action returns a 200 OK response code and a microsoft.graph.security.mergeResponse object in the response body.
Examples
Example 1: Merge incidents
Request
The following example merges two incidents.
POST https://graph.microsoft.com/beta/security/incidents/mergeIncidents
Content-Type: application/json
{
"incidentIds": [
"2972395",
"2972396"
],
"incidentComment": "Merging related incidents from the same campaign",
"mergeReasons": "sameCampaign, sameActor"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Security.Incidents.MicrosoftGraphSecurityMergeIncidents;
using Microsoft.Graph.Beta.Models.Security;
var requestBody = new MergeIncidentsPostRequestBody
{
IncidentIds = new List<string>
{
"2972395",
"2972396",
},
IncidentComment = "Merging related incidents from the same campaign",
MergeReasons = CorrelationReason.SameCampaign | CorrelationReason.SameActor,
};
// To initialize your graphClient, see https://dotnet.territoriali.olinfo.it/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Security.Incidents.MicrosoftGraphSecurityMergeIncidents.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphsecurity "github.com/microsoftgraph/msgraph-beta-sdk-go/security"
graphmodelssecurity "github.com/microsoftgraph/msgraph-beta-sdk-go/models/security"
//other-imports
)
requestBody := graphsecurity.NewMergeIncidentsPostRequestBody()
incidentIds := []string {
"2972395",
"2972396",
}
requestBody.SetIncidentIds(incidentIds)
incidentComment := "Merging related incidents from the same campaign"
requestBody.SetIncidentComment(&incidentComment)
mergeReasons := graphmodels.SAMECAMPAIGN, SAMEACTOR_CORRELATIONREASON
requestBody.SetMergeReasons(&mergeReasons)
// To initialize your graphClient, see https://dotnet.territoriali.olinfo.it/en-us/graph/sdks/create-client?from=snippets&tabs=go
microsoftGraphSecurityMergeIncidents, err := graphClient.Security().Incidents().MicrosoftGraphSecurityMergeIncidents().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.security.incidents.microsoftgraphsecuritymergeincidents.MergeIncidentsPostRequestBody mergeIncidentsPostRequestBody = new com.microsoft.graph.beta.security.incidents.microsoftgraphsecuritymergeincidents.MergeIncidentsPostRequestBody();
LinkedList<String> incidentIds = new LinkedList<String>();
incidentIds.add("2972395");
incidentIds.add("2972396");
mergeIncidentsPostRequestBody.setIncidentIds(incidentIds);
mergeIncidentsPostRequestBody.setIncidentComment("Merging related incidents from the same campaign");
mergeIncidentsPostRequestBody.setMergeReasons(EnumSet.of(com.microsoft.graph.beta.models.security.CorrelationReason.SameCampaign, com.microsoft.graph.beta.models.security.CorrelationReason.SameActor));
var result = graphClient.security().incidents().microsoftGraphSecurityMergeIncidents().post(mergeIncidentsPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const mergeResponse = {
incidentIds: [
'2972395',
'2972396'
],
incidentComment: 'Merging related incidents from the same campaign',
mergeReasons: 'sameCampaign, sameActor'
};
await client.api('/security/incidents/mergeIncidents')
.version('beta')
.post(mergeResponse);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Security\Incidents\MicrosoftGraphSecurityMergeIncidents\MergeIncidentsPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\Security\CorrelationReason;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new MergeIncidentsPostRequestBody();
$requestBody->setIncidentIds(['2972395', '2972396', ]);
$requestBody->setIncidentComment('Merging related incidents from the same campaign');
$requestBody->setMergeReasons(new CorrelationReason('sameCampaign, sameActor'));
$result = $graphServiceClient->security()->incidents()->microsoftGraphSecurityMergeIncidents()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.security.incidents.microsoft_graph_security_merge_incidents.merge_incidents_post_request_body import MergeIncidentsPostRequestBody
from msgraph_beta.generated.models.correlation_reason import CorrelationReason
# To initialize your graph_client, see https://dotnet.territoriali.olinfo.it/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = MergeIncidentsPostRequestBody(
incident_ids = [
"2972395",
"2972396",
],
incident_comment = "Merging related incidents from the same campaign",
merge_reasons = CorrelationReason.SameCampaign | CorrelationReason.SameActor,
)
result = await graph_client.security.incidents.microsoft_graph_security_merge_incidents.post(request_body)
Response
The following example shows the response.
HTTP/1.1 200 OK
Content-type: application/json
{
"targetIncidentId": "2972395"
}