{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/knoxcall/json-schema/knoxcall-opportunity-schema.json",
  "title": "Opportunity",
  "description": "A promotion suggestion (agent_monitor or gateway_traffic source).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/knoxcall-opportunities-api-openapi.yml#/components/schemas/Opportunity",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "source": {
      "type": "string",
      "enum": [
        "agent_monitor",
        "gateway_traffic"
      ]
    },
    "service": {
      "type": "string",
      "description": "Provider label (e.g. \"stripe\") or the host."
    },
    "destination_host": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "snoozed",
        "onboarded",
        "dismissed"
      ]
    },
    "confidence": {
      "type": [
        "number",
        "null"
      ]
    },
    "suggested_route_json": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true
    },
    "evidence_json": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true,
      "description": "Detection evidence (call_count, active_days, methods, window). Host-only — never a path/body/credential."
    },
    "accepted_route_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "acted_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  }
}