{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/credoai/main/json-schema/credoai-aievents-response-schema.json",
  "title": "AIEventsResponse",
  "description": "Response containing a collection of AI events",
  "x-generated": "2026-10-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/credoai-openapi.json#/components/schemas/AIEventsResponse",
  "properties": {
    "data": {
      "description": "Array of AI event resources",
      "items": {
        "description": "An AI event in the system",
        "properties": {
          "attributes": {
            "description": "AI event attributes",
            "properties": {
              "action": {
                "description": "Action that was performed",
                "type": [
                  "string",
                  "null"
                ]
              },
              "app_name": {
                "description": "Name of the application where the event occurred",
                "type": [
                  "string",
                  "null"
                ]
              },
              "category": {
                "description": "Category classification of the event",
                "type": [
                  "string",
                  "null"
                ]
              },
              "department": {
                "description": "Department of the user",
                "type": [
                  "string",
                  "null"
                ]
              },
              "device_hostname": {
                "description": "Hostname of the device where the event occurred",
                "type": [
                  "string",
                  "null"
                ]
              },
              "inserted_at": {
                "description": "Creation timestamp",
                "format": "date-time",
                "type": "string"
              },
              "referrer_url": {
                "description": "Referrer URL for the event",
                "type": [
                  "string",
                  "null"
                ]
              },
              "risk_score": {
                "description": "Risk score for the event (0-100)",
                "maximum": 100,
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "timestamp": {
                "description": "Timestamp of the AI event",
                "format": "date-time",
                "type": "string"
              },
              "updated_at": {
                "description": "Last update timestamp",
                "format": "date-time",
                "type": "string"
              },
              "url": {
                "description": "URL associated with the event",
                "type": [
                  "string",
                  "null"
                ]
              },
              "user_email": {
                "description": "Email address of the user associated with the event",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "timestamp",
              "inserted_at",
              "updated_at"
            ],
            "type": "object"
          },
          "id": {
            "description": "Unique identifier for the AI event",
            "type": "string"
          },
          "type": {
            "description": "Resource type identifier",
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "attributes"
        ],
        "title": "AIEvent",
        "type": "object"
      },
      "type": "array"
    },
    "included": {
      "description": "Included related resources when the 'include' parameter is used",
      "items": {
        "properties": {
          "attributes": {
            "description": "The JSON-API resource attributes",
            "type": "object"
          },
          "id": {
            "description": "The JSON-API resource ID",
            "type": "string"
          },
          "type": {
            "description": "The JSON-API resource type",
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": [
        "array",
        "null"
      ]
    }
  },
  "required": [
    "data"
  ],
  "type": "object"
}