{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cekura-ai/json-schema/cekura-ai-alert-detail-schema.json",
  "title": "AlertDetail",
  "description": "Detailed serializer for alert retrieval",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cekura-ai-observability-api-openapi.yml#/components/schemas/AlertDetail",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "readOnly": true
    },
    "name": {
      "type": "string",
      "description": "Alert name",
      "maxLength": 255
    },
    "enabled": {
      "type": "boolean",
      "description": "Enable/disable alert"
    },
    "project": {
      "type": "integer",
      "description": "Project this alert belongs to"
    },
    "project_name": {
      "type": "string",
      "readOnly": true
    },
    "source_type": {
      "enum": [
        "metric"
      ],
      "type": "string",
      "x-spec-enum-id": "2713692dc60667c9",
      "description": "Type of data source: metric, duration, call_volume, etc.\n\n* `metric` - Metric"
    },
    "source_id": {
      "type": [
        "integer",
        "null"
      ],
      "maximum": 2147483647,
      "minimum": 0,
      "description": "ID of monitored object"
    },
    "source_object_name": {
      "type": "string",
      "readOnly": true
    },
    "source_object_details": {
      "type": "object",
      "additionalProperties": {},
      "description": "Get basic details about the source object",
      "readOnly": true
    },
    "source": {
      "description": "Source config keyed on `sub_type`. `normal`: {sub_type, filters?}. `significant_change`: {sub_type, window_size, filters?}. `threshold`: {sub_type, window_size, filters?}. `insight_new_mode`: {sub_type, min_calls?} — fires when a new failure mode is detected for the metric. `insight_uptick`: {sub_type, window_hours, baseline_hours} — fires when a failure mode's recent volume spikes vs its baseline. `filters` is an optional CallLogQueryFilter expression."
    },
    "threshold": {
      "description": "Threshold config keyed on the source's `sub_type`. `normal`: {} (fires on every failing eval). `significant_change`: {std_multiplier, ewma_alpha, direction}. `threshold`: {operator (gt|lt|outside), value (number | {low, high}), min_breaches}. `insight_new_mode`: {} (fires when a new failure mode appears). `insight_uptick`: {min_count, multiplier}."
    },
    "notifications": {
      "description": "Notification routing. `{slack: {workspace_id, channel_id?}}` to send to a specific workspace/channel. Empty fans out to every project workspace; empty + no project workspaces means the alert is silent."
    },
    "last_triggered_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "readOnly": true,
      "description": "Last trigger timestamp"
    },
    "trigger_count": {
      "type": "integer",
      "readOnly": true,
      "description": "Total triggers count"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "last_updated_by": {
      "type": [
        "integer",
        "null"
      ],
      "readOnly": true,
      "description": "User who last updated this alert"
    },
    "last_updated_by_email": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true
    }
  },
  "required": [
    "name",
    "project",
    "source_type"
  ]
}