{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/adt/refs/heads/main/json-schema/platform-api-event-schema.json",
  "title": "Event",
  "description": "A security event or alarm history entry.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier of the event.",
      "example": "evt-001"
    },
    "type": {
      "type": "string",
      "description": "Type of security event.",
      "enum": [
        "alarm",
        "arm",
        "disarm",
        "sensor_open",
        "sensor_close",
        "motion",
        "video",
        "panic"
      ],
      "example": "alarm"
    },
    "description": {
      "type": "string",
      "description": "Human-readable description of the event.",
      "example": "Motion detected at front door"
    },
    "deviceId": {
      "type": "string",
      "description": "ID of the device that triggered the event.",
      "example": "dev-001"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp when the event occurred.",
      "example": "2025-03-15T14:30:00Z"
    },
    "userId": {
      "type": "string",
      "description": "ID of the user associated with the event.",
      "example": "usr-001"
    }
  }
}