警报: createAlert

命名空间: microsoft.graph.security

重要

Microsoft Graph /beta 版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。

通过对集合调用 alerts_v2 绑定操作并返回创建的 警报 资源来创建 Microsoft 365 Defender 警报。 该操作接受 createAlertInput 复杂类型,该类型将警报元数据和特定于创建的选项组合在一个请求对象中。

API 可用性

此 API 可用于以下国家级云部署。

全局服务 美国政府 L4 美国政府 L5 (DOD) 由世纪互联运营的中国
✅ ✅ ✅ ❌

权限

为此 API 选择标记为最低特权的权限。 只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。

权限类型 最低特权权限 更高特权权限
委派(工作或学校帐户) SecurityAlert.Create.All SecurityAlert.ReadWrite.All
委派(个人 Microsoft 帐户) 不支持。 不支持。
应用程序 SecurityAlert.Create.All SecurityAlert.ReadWrite.All

HTTP 请求

POST /security/alerts_v2/createAlert

请求标头

名称 说明
Authorization 持有者 {token}。 必填。 详细了解 身份验证和授权。
Content-Type application/json. 必需。

请求正文

在请求正文中,提供参数的 JSON 表示形式。

下表列出了调用此操作时所需的参数。

参数 类型 说明
createAlertInput microsoft.graph.security.createAlertInput 必填。 包含警报属性、事件链接选项、工作区路由和内联实体定义的输入。

响应

如果成功,此操作将在响应正文中返回 201 Created 响应代码和 警报 对象。

示例

示例 1:创建链接到现有事件的警报

请求

以下示例显示了一个创建警报并将其链接到事件 42 的请求。

POST https://graph.microsoft.com/beta/security/alerts_v2/createAlert
Content-Type: application/json

{
  "createAlertInput": {
    "title": "Suspicious PowerShell activity",
    "severity": "medium",
    "description": "PowerShell script execution was identified during analyst triage.",
    "category": "Execution",
    "recommendedActions": "Review the script contents and isolate the affected device.",
    "mitreTechniques": ["T1059.001"],
    "linkToIncident": 42,
    "isExcludedFromCorrelation": false,
    "entityDefinitions": [
      {
        "entityType": "device",
        "entityIdentifier": "deviceId",
        "identifierValue": "d1234567-abcd-4f01-8abc-890123456789",
        "role": "impacted"
      }
    ]
  }
}

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.type": "#microsoft.graph.security.alert",
  "id": "ea2c5e5341-c60a-42fc-953f-3da427c85e2d_aml",
  "providerAlertId": "manual_ea2c5e5341-c60a-42fc-953f-3da427c85e2d",
  "incidentId": "42",
  "title": "Suspicious PowerShell activity",
  "description": "PowerShell script execution was identified during analyst triage.",
  "severity": "medium",
  "status": "new",
  "classification": "unknown",
  "determination": "unknown",
  "category": "Execution",
  "serviceSource": "microsoft365Defender",
  "detectionSource": "manual",
  "createdDateTime": "2026-07-27T11:00:00Z",
  "lastUpdateDateTime": "2026-07-27T11:00:00Z",
  "recommendedActions": "Review the script contents and isolate the affected device.",
  "mitreTechniques": ["T1059.001"],
  "alertWebUrl": "https://security.microsoft.com/alerts/ea2c5e5341-c60a-42fc-953f-3da427c85e2d_aml"
}

示例 2:使用新事件创建警报

请求

以下示例显示了一个请求,该请求创建警报而不指定事件,导致后端创建新事件。

POST https://graph.microsoft.com/beta/security/alerts_v2/createAlert
Content-Type: application/json

{
  "createAlertInput": {
    "title": "Unauthorized access attempt",
    "severity": "high",
    "description": "Multiple failed login attempts from an unusual location.",
    "category": "InitialAccess",
    "mitreTechniques": ["T1078"],
    "isExcludedFromCorrelation": false,
    "entityDefinitions": [
      {
        "entityType": "user",
        "entityIdentifier": "userPrincipalName",
        "identifierValue": "admin@contoso.com",
        "role": "impacted"
      },
      {
        "entityType": "ip",
        "entityIdentifier": "address",
        "identifierValue": "198.51.100.42",
        "role": "related"
      }
    ]
  }
}

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.type": "#microsoft.graph.security.alert",
  "id": "bf3c9e7812-a45b-44dc-8e2f-1a2b3c4d5e6f_aml",
  "providerAlertId": "manual_bf3c9e7812-a45b-44dc-8e2f-1a2b3c4d5e6f",
  "incidentId": "128",
  "title": "Unauthorized access attempt",
  "severity": "high",
  "status": "new",
  "category": "InitialAccess",
  "serviceSource": "microsoft365Defender",
  "detectionSource": "manual",
  "createdDateTime": "2026-07-27T12:30:00Z",
  "lastUpdateDateTime": "2026-07-27T12:30:00Z",
  "alertWebUrl": "https://security.microsoft.com/alerts/bf3c9e7812-a45b-44dc-8e2f-1a2b3c4d5e6f_aml"
}