{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-defender/json-schema/microsoft-defender-microsoft-graph-security-retention-event-schema.json",
  "title": "microsoft.graph.security.retentionEvent",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-defender-security-triggersroot-api-openapi.yml#/components/schemas/microsoft.graph.security.retentionEvent",
  "allOf": [
    {
      "$ref": "#/$defs/microsoft.graph.entity"
    },
    {
      "title": "retentionEvent",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "createdBy": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.identitySet"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "The user who created the retentionEvent."
        },
        "createdDateTime": {
          "pattern": "^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$",
          "type": [
            "string",
            "null"
          ],
          "description": "The date time when the retentionEvent was created.",
          "format": "date-time"
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "Optional information about the event."
        },
        "displayName": {
          "type": [
            "string",
            "null"
          ],
          "description": "Name of the event."
        },
        "eventPropagationResults": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/microsoft.graph.security.eventPropagationResult"
          },
          "description": "Represents the success status of a created event and additional information."
        },
        "eventQueries": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/microsoft.graph.security.eventQuery"
          },
          "description": "Represents the workload (SharePoint Online, OneDrive for Business, Exchange Online) and identification information associated with a retention event."
        },
        "eventStatus": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.security.retentionEventStatus"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "Status of event propogation to the scoped locations after the event has been created."
        },
        "eventTriggerDateTime": {
          "pattern": "^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$",
          "type": [
            "string",
            "null"
          ],
          "description": "Optional time when the event should be triggered.",
          "format": "date-time"
        },
        "lastModifiedBy": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.identitySet"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "The user who last modified the retentionEvent."
        },
        "lastModifiedDateTime": {
          "pattern": "^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$",
          "type": [
            "string",
            "null"
          ],
          "description": "The latest date time when the retentionEvent was modified.",
          "format": "date-time"
        },
        "lastStatusUpdateDateTime": {
          "pattern": "^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$",
          "type": [
            "string",
            "null"
          ],
          "description": "Last time the status of the event was updated.",
          "format": "date-time"
        },
        "retentionEventType": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.security.retentionEventType"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "Specifies the event that will start the retention period for labels that use this event type when an event is created.",
          "x-ms-navigationProperty": true
        },
        "@odata.type": {
          "type": "string"
        }
      }
    }
  ],
  "x-ms-discriminator-value": "#microsoft.graph.security.retentionEvent",
  "$defs": {
    "microsoft.graph.entity": {
      "title": "entity",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique identifier for an entity. Read-only."
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.identity": {
      "title": "identity",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "displayName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The display name of the identity.For drive items, the display name might not always be available or up to date. For example, if a user changes their display name the API might show the new value in a future response, but the items associated with the user don't show up as changed when using delta."
        },
        "id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Unique identifier for the identity or actor. For example, in the access reviews decisions API, this property might record the id of the principal, that is, the group, user, or application that's subject to review."
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.identitySet": {
      "title": "identitySet",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "application": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.identity"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "Optional. The application associated with this action."
        },
        "device": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.identity"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "Optional. The device associated with this action."
        },
        "user": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.identity"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "Optional. The user associated with this action."
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.publicError": {
      "title": "publicError",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "Represents the error code."
        },
        "details": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/microsoft.graph.publicErrorDetail"
          },
          "description": "Details of the error."
        },
        "innerError": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.publicInnerError"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "Details of the inner error."
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "A non-localized message for the developer."
        },
        "target": {
          "type": [
            "string",
            "null"
          ],
          "description": "The target of the error."
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.publicErrorDetail": {
      "title": "publicErrorDetail",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The error code."
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "The error message."
        },
        "target": {
          "type": [
            "string",
            "null"
          ],
          "description": "The target of the error."
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.publicInnerError": {
      "title": "publicInnerError",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The error code."
        },
        "details": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/microsoft.graph.publicErrorDetail"
          },
          "description": "A collection of error details."
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "The error message."
        },
        "target": {
          "type": [
            "string",
            "null"
          ],
          "description": "The target of the error."
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.security.eventPropagationResult": {
      "title": "eventPropagationResult",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "location": {
          "type": [
            "string",
            "null"
          ],
          "description": "The name of the specific location in the workload associated with the event."
        },
        "serviceName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The name of the workload associated with the event."
        },
        "status": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.security.eventPropagationStatus"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "Indicates the status of the event creation request. The possible values are: none, inProcessing, failed, success, unknownFutureValue."
        },
        "statusInformation": {
          "type": [
            "string",
            "null"
          ],
          "description": "Additional information about the status of the event creation request."
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.security.eventPropagationStatus": {
      "title": "eventPropagationStatus",
      "enum": [
        "none",
        "inProcessing",
        "failed",
        "success",
        "unknownFutureValue"
      ],
      "type": "string"
    },
    "microsoft.graph.security.eventQuery": {
      "title": "eventQuery",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "query": {
          "type": "string",
          "description": "Represents unique identification for the  query. 'Asset ID' for SharePoint Online and OneDrive for Business, 'keywords' for Exchange Online."
        },
        "queryType": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.security.queryType"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "Represents the type of query associated with an event. 'files' for SPO and ODB and 'messages' for EXO.The possible values are: files, messages, unknownFutureValue."
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.security.eventStatusType": {
      "title": "eventStatusType",
      "enum": [
        "pending",
        "error",
        "success",
        "notAvaliable",
        "unknownFutureValue"
      ],
      "type": "string"
    },
    "microsoft.graph.security.queryType": {
      "title": "queryType",
      "enum": [
        "files",
        "messages",
        "unknownFutureValue"
      ],
      "type": "string"
    },
    "microsoft.graph.security.retentionEventStatus": {
      "title": "retentionEventStatus",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "error": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.publicError"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "The error if the status isn't successful."
        },
        "status": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.security.eventStatusType"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "The status of the distribution. The possible values are: pending, error, success, notAvaliable."
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.security.retentionEventType": {
      "allOf": [
        {
          "$ref": "#/$defs/microsoft.graph.entity"
        },
        {
          "title": "retentionEventType",
          "required": [
            "@odata.type"
          ],
          "type": "object",
          "properties": {
            "createdBy": {
              "anyOf": [
                {
                  "$ref": "#/$defs/microsoft.graph.identitySet"
                },
                {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              ],
              "description": "The user who created the retentionEventType."
            },
            "createdDateTime": {
              "pattern": "^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$",
              "type": [
                "string",
                "null"
              ],
              "description": "The date time when the retentionEventType was created.",
              "format": "date-time"
            },
            "description": {
              "type": [
                "string",
                "null"
              ],
              "description": "Optional information about the event type."
            },
            "displayName": {
              "type": [
                "string",
                "null"
              ],
              "description": "Name of the event type."
            },
            "lastModifiedBy": {
              "anyOf": [
                {
                  "$ref": "#/$defs/microsoft.graph.identitySet"
                },
                {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              ],
              "description": "The user who last modified the retentionEventType."
            },
            "lastModifiedDateTime": {
              "pattern": "^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$",
              "type": [
                "string",
                "null"
              ],
              "description": "The latest date time when the retentionEventType was modified.",
              "format": "date-time"
            },
            "@odata.type": {
              "type": "string"
            }
          }
        }
      ],
      "x-ms-discriminator-value": "#microsoft.graph.security.retentionEventType"
    }
  }
}