{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/credoai/main/json-schema/credoai-aievent-bulk-create-request-schema.json",
  "title": "AIEventBulkCreateRequest",
  "description": "Request schema for creating multiple AI events in bulk. Accepts either JSONAPI format with a 'data' array or simple format with an 'events' array.",
  "x-generated": "2026-10-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/credoai-openapi.json#/components/schemas/AIEventBulkCreateRequest",
  "properties": {
    "data": {
      "description": "Array of AI event data objects in JSONAPI format. Each object should have 'attributes' containing the event data.",
      "items": {
        "properties": {
          "attributes": {
            "properties": {
              "action": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "app_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "category": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "department": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "device_hostname": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "referrer_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "risk_score": {
                "maximum": 100,
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "timestamp": {
                "description": "Timestamp of the AI event in ISO-8601 format",
                "format": "date-time",
                "type": "string"
              },
              "url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "user_email": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "timestamp"
            ],
            "type": "object"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "attributes"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "events": {
      "description": "Array of AI event objects in simple format",
      "items": {
        "properties": {
          "action": {
            "type": [
              "string",
              "null"
            ]
          },
          "app_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "department": {
            "type": [
              "string",
              "null"
            ]
          },
          "device_hostname": {
            "type": [
              "string",
              "null"
            ]
          },
          "referrer_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "risk_score": {
            "maximum": 100,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "timestamp": {
            "description": "Timestamp of the AI event in ISO-8601 format",
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "user_email": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "timestamp"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "type": "object"
}