{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/brixsignage-com/json-schema/brixsignage-com-ai-event-schema.json",
  "title": "AiEvent",
  "description": "One AI call (or refusal) the workspace made.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/brixsignage-com-ai-api-openapi.yml#/components/schemas/AiEvent",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "spaceId": {
      "type": "string"
    },
    "nodeId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The location of the content the call was about; null for the workspace root."
    },
    "actor": {
      "type": "string",
      "description": "Who made the call. An actor reference: `user:<id>`, `apikey:<id>`, `staff:<email>`, `partner:<email>` or `system…`. Without `user.view` at the event's location, only the kind (`user`, `staff`, …)."
    },
    "feature": {
      "type": "string",
      "description": "`tags`, `alt-text`, `moderation`, `transcription`, `translation`, `focal-region`, `embedding`, …"
    },
    "featureLabel": {
      "type": "string",
      "description": "The feature's display name (the raw key for an unknown feature)."
    },
    "sends": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "What the feature sends to the model; null for an unknown feature."
    },
    "model": {
      "type": "string"
    },
    "provider": {
      "type": "string"
    },
    "outcome": {
      "type": "string",
      "enum": [
        "ok",
        "blocked",
        "error",
        "quota",
        "disabled"
      ]
    },
    "durationMs": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "inputKind": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "`image`, `text` or `audio`: what was sent, never the content."
    },
    "redactions": {
      "type": "integer",
      "description": "Personal-data patterns masked before the call."
    },
    "detail": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "createdAt": {
      "type": "string",
      "description": "ISO-8601 timestamp (UTC)."
    }
  },
  "required": [
    "id",
    "spaceId",
    "nodeId",
    "actor",
    "feature",
    "featureLabel",
    "sends",
    "model",
    "provider",
    "outcome",
    "durationMs",
    "inputKind",
    "redactions",
    "detail",
    "createdAt"
  ]
}