{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/credoai/main/json-schema/credoai-aievent-create-request-schema.json",
  "title": "AIEventCreateRequest",
  "description": "Request schema for creating an AI event",
  "x-generated": "2026-10-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/credoai-openapi.json#/components/schemas/AIEventCreateRequest",
  "properties": {
    "data": {
      "description": "AI event data",
      "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"
              ]
            },
            "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 in ISO-8601 format",
              "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"
          ],
          "type": "object"
        },
        "type": {
          "description": "The JSON-API resource type",
          "type": "string"
        }
      },
      "required": [
        "type",
        "attributes"
      ],
      "type": "object"
    }
  },
  "required": [
    "data"
  ],
  "type": "object"
}