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.
Move one or more alert resources to an existing 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
In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. The following least privileged roles are supported for this operation.
- 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/alerts_v2/moveAlerts
Request body
In the request body, provide a JSON object with the following parameters.
| Parameter |
Type |
Description |
| alertIds |
String collection |
Required. The IDs of the alerts to move. |
| incidentId |
String |
Optional. The ID of the target incident. A request with null creates a new incident. |
| alertComment |
String |
Optional. A comment to add when moving the alerts. |
| newCorrelationReasons |
microsoft.graph.security.correlationReason |
Optional. The correlation reasons to associate with the move operation. 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: Move alerts to an incident
Request
The following example moves two alerts to an existing incident.
POST https://graph.microsoft.com/beta/security/alerts_v2/moveAlerts
Content-Type: application/json
{
"alertIds": [
"da637551227677560813_-961444813",
"da637551227677560813_-961444814"
],
"incidentId": "2972395",
"alertComment": "Moving alerts for investigation consolidation",
"newCorrelationReasons": "sameAsset, temporalProximity"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Security.Alerts_v2.MicrosoftGraphSecurityMoveAlerts;
using Microsoft.Graph.Beta.Models.Security;
var requestBody = new MoveAlertsPostRequestBody
{
AlertIds = new List<string>
{
"da637551227677560813_-961444813",
"da637551227677560813_-961444814",
},
IncidentId = "2972395",
AlertComment = "Moving alerts for investigation consolidation",
NewCorrelationReasons = CorrelationReason.SameAsset | CorrelationReason.TemporalProximity,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Security.Alerts_v2.MicrosoftGraphSecurityMoveAlerts.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.NewMoveAlertsPostRequestBody()
alertIds := []string {
"da637551227677560813_-961444813",
"da637551227677560813_-961444814",
}
requestBody.SetAlertIds(alertIds)
incidentId := "2972395"
requestBody.SetIncidentId(&incidentId)
alertComment := "Moving alerts for investigation consolidation"
requestBody.SetAlertComment(&alertComment)
newCorrelationReasons := graphmodels.SAMEASSET, TEMPORALPROXIMITY_CORRELATIONREASON
requestBody.SetNewCorrelationReasons(&newCorrelationReasons)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
microsoftGraphSecurityMoveAlerts, err := graphClient.Security().Alerts_v2().MicrosoftGraphSecurityMoveAlerts().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.alerts_v2.microsoftgraphsecuritymovealerts.MoveAlertsPostRequestBody moveAlertsPostRequestBody = new com.microsoft.graph.beta.security.alerts_v2.microsoftgraphsecuritymovealerts.MoveAlertsPostRequestBody();
LinkedList<String> alertIds = new LinkedList<String>();
alertIds.add("da637551227677560813_-961444813");
alertIds.add("da637551227677560813_-961444814");
moveAlertsPostRequestBody.setAlertIds(alertIds);
moveAlertsPostRequestBody.setIncidentId("2972395");
moveAlertsPostRequestBody.setAlertComment("Moving alerts for investigation consolidation");
moveAlertsPostRequestBody.setNewCorrelationReasons(EnumSet.of(com.microsoft.graph.beta.models.security.CorrelationReason.SameAsset, com.microsoft.graph.beta.models.security.CorrelationReason.TemporalProximity));
var result = graphClient.security().alertsV2().microsoftGraphSecurityMoveAlerts().post(moveAlertsPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const mergeResponse = {
alertIds: [
'da637551227677560813_-961444813',
'da637551227677560813_-961444814'
],
incidentId: '2972395',
alertComment: 'Moving alerts for investigation consolidation',
newCorrelationReasons: 'sameAsset, temporalProximity'
};
await client.api('/security/alerts_v2/moveAlerts')
.version('beta')
.post(mergeResponse);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Security\Alerts_v2\MicrosoftGraphSecurityMoveAlerts\MoveAlertsPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\Security\CorrelationReason;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new MoveAlertsPostRequestBody();
$requestBody->setAlertIds(['da637551227677560813_-961444813', 'da637551227677560813_-961444814', ]);
$requestBody->setIncidentId('2972395');
$requestBody->setAlertComment('Moving alerts for investigation consolidation');
$requestBody->setNewCorrelationReasons(new CorrelationReason('sameAsset, temporalProximity'));
$result = $graphServiceClient->security()->alerts_v2()->microsoftGraphSecurityMoveAlerts()->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.alerts_v2.microsoft_graph_security_move_alerts.move_alerts_post_request_body import MoveAlertsPostRequestBody
from msgraph_beta.generated.models.correlation_reason import CorrelationReason
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = MoveAlertsPostRequestBody(
alert_ids = [
"da637551227677560813_-961444813",
"da637551227677560813_-961444814",
],
incident_id = "2972395",
alert_comment = "Moving alerts for investigation consolidation",
new_correlation_reasons = CorrelationReason.SameAsset | CorrelationReason.TemporalProximity,
)
result = await graph_client.security.alerts_v2.microsoft_graph_security_move_alerts.post(request_body)
Response
The following example shows the response.
HTTP/1.1 200 OK
Content-type: application/json
{
"targetIncidentId": "2972395"
}