{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aixbt-tech/json-schema/aixbt-tech-alert-schema.json",
  "title": "Alert",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aixbt-tech-v3-openapi.yaml#/components/schemas/Alert",
  "type": "object",
  "required": [
    "id",
    "status",
    "trigger",
    "selector",
    "cadence",
    "destinationIds",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "paused"
      ]
    },
    "trigger": {
      "$ref": "#/$defs/AlertTrigger"
    },
    "rankThreshold": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "description": "Top-N boundary; present only with `rank.entered`."
    },
    "ranking": {
      "type": "string",
      "enum": [
        "trend"
      ],
      "default": "trend",
      "description": "Ranking watched by `rank.entered`; omitted stored rows mean Trend."
    },
    "selector": {
      "$ref": "#/$defs/AlertSelector"
    },
    "cadence": {
      "$ref": "#/$defs/AlertCadence"
    },
    "destinationIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 1
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "AlertCadence": {
      "type": "string",
      "enum": [
        "instant",
        "hourly",
        "every_12h",
        "daily"
      ],
      "description": "Chat delivery cadence. First event in a window delivers immediately;\nthe window bundles the rest. `instant` is subject to a per-day\nplatform safety ceiling.\n"
    },
    "AlertQualifiers": {
      "type": "object",
      "description": "Filter qualifiers; each list holds at most 20 values.\n`grades`, `sentiments`, `clusterIds`, `maxRank`, and\n`hasOfficialSource` qualify `intelligence.material` subscriptions;\n`chains` qualifies `rank.entered`; `categories` and `assetTypes`\nqualify both.\n",
      "properties": {
        "categories": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "grades": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Grade"
          }
        },
        "sentiments": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "assetTypes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "clusterIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "chains": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "maxRank": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "description": "Only intel on Projects at or above this rank in the Trend cohort."
        },
        "hasOfficialSource": {
          "type": "boolean"
        }
      }
    },
    "AlertSelector": {
      "type": "object",
      "additionalProperties": false,
      "description": "What the subscription watches: the owner's followed Projects, the\ncurrently ranked cohort, a normalized keyword, or a qualifier-only cohort.\nExplicit per-Project and per-Topic id lists are not yet supported\nand will join additively.\n",
      "properties": {
        "followedProjects": {
          "type": "boolean",
          "description": "Only the owner's followed Projects. Mutually exclusive with the ranked Project scopes."
        },
        "trendingProjects": {
          "type": "boolean",
          "description": "Only Projects in the current Trend ranking. Mutually exclusive with `followedProjects`."
        },
        "keyword": {
          "type": "string",
          "minLength": 2,
          "maxLength": 64,
          "description": "Normalized once at save time; matched case-insensitively against source-derived text."
        },
        "qualifiers": {
          "$ref": "#/$defs/AlertQualifiers"
        }
      }
    },
    "AlertTrigger": {
      "type": "string",
      "enum": [
        "intelligence.material",
        "rank.entered"
      ],
      "description": "The set of launch triggers."
    },
    "Grade": {
      "type": "string",
      "enum": [
        "chipped",
        "flawed",
        "cut",
        "polished",
        "flawless"
      ],
      "description": "Evidence grade of an Intel item, lowest to highest. Grades describe\nthe shape of the evidence, never the truth of the claim.\n"
    }
  }
}