{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-graph/json-schema/microsoft-graph-microsoft-graph-ai-interaction-schema.json",
  "title": "microsoft.graph.aiInteraction",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-graph-copilot-aiinteractionhistory-api-openapi.yml#/components/schemas/microsoft.graph.aiInteraction",
  "allOf": [
    {
      "$ref": "#/$defs/microsoft.graph.entity"
    },
    {
      "title": "aiInteraction",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "appClass": {
          "type": "string"
        },
        "attachments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/microsoft.graph.aiInteractionAttachment"
          }
        },
        "body": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.itemBody"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ]
        },
        "contexts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/microsoft.graph.aiInteractionContext"
          }
        },
        "conversationType": {
          "type": [
            "string",
            "null"
          ]
        },
        "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"
          ],
          "format": "date-time"
        },
        "etag": {
          "type": [
            "string",
            "null"
          ]
        },
        "from": {
          "$ref": "#/$defs/microsoft.graph.identitySet"
        },
        "interactionType": {
          "$ref": "#/$defs/microsoft.graph.aiInteractionType"
        },
        "links": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/microsoft.graph.aiInteractionLink"
          }
        },
        "locale": {
          "type": "string"
        },
        "mentions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/microsoft.graph.aiInteractionMention"
          }
        },
        "requestId": {
          "type": "string"
        },
        "sessionId": {
          "type": "string"
        },
        "@odata.type": {
          "type": "string"
        }
      }
    }
  ],
  "x-ms-discriminator-value": "#microsoft.graph.aiInteraction",
  "$defs": {
    "microsoft.graph.aiInteractionAttachment": {
      "title": "aiInteractionAttachment",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "attachmentId": {
          "type": [
            "string",
            "null"
          ]
        },
        "content": {
          "type": [
            "string",
            "null"
          ]
        },
        "contentType": {
          "type": [
            "string",
            "null"
          ]
        },
        "contentUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.aiInteractionContext": {
      "title": "aiInteractionContext",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "contextReference": {
          "type": [
            "string",
            "null"
          ]
        },
        "contextType": {
          "type": [
            "string",
            "null"
          ]
        },
        "displayName": {
          "type": [
            "string",
            "null"
          ]
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.aiInteractionLink": {
      "title": "aiInteractionLink",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "displayName": {
          "type": [
            "string",
            "null"
          ]
        },
        "linkType": {
          "type": [
            "string",
            "null"
          ]
        },
        "linkUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.aiInteractionMention": {
      "title": "aiInteractionMention",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "mentioned": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.aiInteractionMentionedIdentitySet"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ]
        },
        "mentionId": {
          "maximum": 2147483647,
          "minimum": -2147483648,
          "type": [
            "number",
            "null"
          ],
          "format": "int32"
        },
        "mentionText": {
          "type": [
            "string",
            "null"
          ]
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.aiInteractionMentionedIdentitySet": {
      "allOf": [
        {
          "$ref": "#/$defs/microsoft.graph.identitySet"
        },
        {
          "title": "aiInteractionMentionedIdentitySet",
          "required": [
            "@odata.type"
          ],
          "type": "object",
          "properties": {
            "conversation": {
              "anyOf": [
                {
                  "$ref": "#/$defs/microsoft.graph.teamworkConversationIdentity"
                },
                {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              ]
            },
            "tag": {
              "anyOf": [
                {
                  "$ref": "#/$defs/microsoft.graph.teamworkTagIdentity"
                },
                {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              ]
            },
            "@odata.type": {
              "type": "string",
              "default": "#microsoft.graph.aiInteractionMentionedIdentitySet"
            }
          }
        }
      ],
      "x-ms-discriminator-value": "#microsoft.graph.aiInteractionMentionedIdentitySet"
    },
    "microsoft.graph.aiInteractionType": {
      "title": "aiInteractionType",
      "enum": [
        "userPrompt",
        "aiResponse",
        "unknownFutureValue"
      ],
      "type": "string"
    },
    "microsoft.graph.bodyType": {
      "title": "bodyType",
      "enum": [
        "text",
        "html"
      ],
      "type": "string"
    },
    "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.itemBody": {
      "title": "itemBody",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "content": {
          "type": [
            "string",
            "null"
          ],
          "description": "The content of the item."
        },
        "contentType": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.bodyType"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "The type of the content. Possible values are text and html."
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.teamworkConversationIdentity": {
      "allOf": [
        {
          "$ref": "#/$defs/microsoft.graph.identity"
        },
        {
          "title": "teamworkConversationIdentity",
          "required": [
            "@odata.type"
          ],
          "type": "object",
          "properties": {
            "conversationIdentityType": {
              "anyOf": [
                {
                  "$ref": "#/$defs/microsoft.graph.teamworkConversationIdentityType"
                },
                {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              ],
              "description": "Type of conversation. The possible values are: team, channel, chat, and unknownFutureValue."
            },
            "@odata.type": {
              "type": "string",
              "default": "#microsoft.graph.teamworkConversationIdentity"
            }
          }
        }
      ],
      "x-ms-discriminator-value": "#microsoft.graph.teamworkConversationIdentity"
    },
    "microsoft.graph.teamworkConversationIdentityType": {
      "title": "teamworkConversationIdentityType",
      "enum": [
        "team",
        "channel",
        "chat",
        "unknownFutureValue"
      ],
      "type": "string"
    },
    "microsoft.graph.teamworkTagIdentity": {
      "allOf": [
        {
          "$ref": "#/$defs/microsoft.graph.identity"
        },
        {
          "title": "teamworkTagIdentity",
          "required": [
            "@odata.type"
          ],
          "type": "object",
          "properties": {
            "@odata.type": {
              "type": "string",
              "default": "#microsoft.graph.teamworkTagIdentity"
            }
          }
        }
      ],
      "x-ms-discriminator-value": "#microsoft.graph.teamworkTagIdentity"
    }
  }
}