{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/brixsignage-com/json-schema/brixsignage-com-audit-event-schema.json",
  "title": "AuditEvent",
  "description": "One activity log event, with the actor resolved to a name.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/brixsignage-com-audit-api-openapi.yml#/components/schemas/AuditEvent",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "at": {
      "type": "string",
      "description": "ISO-8601 timestamp (UTC)."
    },
    "workspaceId": {
      "type": "string"
    },
    "actor": {
      "type": "string",
      "description": "`user:<id>`, `apikey:<id>`, `system`, `staff` (our support team), or another internal actor."
    },
    "actorKind": {
      "type": "string",
      "enum": [
        "user",
        "api-key",
        "system",
        "brix-support",
        "support"
      ],
      "description": "Our support team made the change: `support` in a workspace a white-label partner owns, `brix-support` otherwise."
    },
    "actorName": {
      "type": "string",
      "description": "The person's or key's name; `System` for the system; the support team's name for `support` / `brix-support`."
    },
    "actorEmail": {
      "type": "string",
      "description": "The person's email; `n/a` for a key; `system@brix` for the system (`system` in a white-label partner's workspace); empty for `support` / `brix-support`."
    },
    "action": {
      "type": "string",
      "description": "What happened, e.g. `screen.renamed`."
    },
    "target": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The id of the thing acted on."
    },
    "detail": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "nodeId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The location the event belongs to; null for the workspace."
    },
    "nodeName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "ipAddress": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "userAgent": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "via": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "mcp",
            "api"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "How it arrived: `mcp` (an MCP tool such as Claude or ChatGPT), `api` (an API key on REST), null (in the Brix app)."
    },
    "viaApp": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The connector or API key behind an `mcp`/`api` event; null for the app."
    }
  },
  "required": [
    "id",
    "at",
    "workspaceId",
    "actor",
    "actorKind",
    "actorName",
    "actorEmail",
    "action",
    "target",
    "detail",
    "nodeId",
    "nodeName",
    "ipAddress",
    "userAgent",
    "via",
    "viaApp"
  ]
}