{
  "openapi": "3.1.0",
  "info": {
    "title": "DefAI API",
    "description": "Scam detection engine. One backend, many clients (web, iOS, Android, browser extension) — see docs/ for the architecture and safety invariants. All endpoints are versioned under /v1. App developers: start at /guide/ios-quickstart and pin to /openapi/v1.json, the stable contract; /openapi.json changes with every release.",
    "version": "0.3.0"
  },
  "paths": {
    "/v1/analyze/message": {
      "post": {
        "summary": "Analyze Message",
        "operationId": "analyze_message_v1_analyze_message_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyzeMessageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyzeMessageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/analyze/batch": {
      "post": {
        "summary": "Analyze Batch",
        "description": "Analyze up to 50 messages in one round trip (mobile SMS filters).\n\nItems are independent: one malformed message returns an error for that\nindex without failing the batch.",
        "operationId": "analyze_batch_v1_analyze_batch_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchAnalyzeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchAnalyzeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rules/pack": {
      "get": {
        "summary": "Rules Pack",
        "description": "Download the deterministic tier for ON-DEVICE evaluation.\n\niOS SMS-filter extensions run without network access, so clients embed these\nrules and evaluate them locally, matching server behaviour exactly (same\nregexes, same weights, same floors). Pass `since_version` (or send\n`If-None-Match`) to get 304 when nothing changed.",
        "operationId": "rules_pack_v1_rules_pack_get",
        "parameters": [
          {
            "name": "since_version",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since Version"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 8
                },
                {
                  "type": "null"
                }
              ],
              "title": "Region"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RulesPackResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rules/delta": {
      "get": {
        "tags": [
          "sync"
        ],
        "summary": "Rules Delta",
        "description": "Incremental intelligence update for a device already holding a pack.\n\nThreat indicators change hourly; rules rarely do. Sending the whole pack\nevery time wastes mobile bandwidth and battery, so devices ask what changed\nsince their serial. If rules, entities or scoring changed, the response sets\n`full_resync_required` — evaluation semantics moved and a delta is not enough.",
        "operationId": "rules_delta_v1_rules_delta_get",
        "parameters": [
          {
            "name": "since_serial",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "title": "Since Serial"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 8
                },
                {
                  "type": "null"
                }
              ],
              "title": "Region"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackDeltaResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/analyze/voice": {
      "post": {
        "summary": "Analyze Voice",
        "description": "Transcribe an uploaded voice recording locally (faster-whisper) and run\nthe full analysis pipeline on the transcript. Audio never leaves the machine\nand is deleted immediately after transcription.",
        "operationId": "analyze_voice_v1_analyze_voice_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_analyze_voice_v1_analyze_voice_post"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceAnalyzeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/call/start": {
      "post": {
        "summary": "Call Start",
        "operationId": "call_start_v1_call_start_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallStartRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallStartResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/call/{call_id}/status": {
      "get": {
        "summary": "Call Status",
        "description": "The current verdict without new speech. The caller check finishes in the\nbackground; clients poll this while `caller_check.status` is \"running\" so\nits result arrives even when nobody is talking.",
        "operationId": "call_status_v1_call__call_id__status_get",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Call Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveCallStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/call/{call_id}/caller": {
      "post": {
        "summary": "Call Set Caller",
        "description": "Type or correct the calling number mid-call; the caller check restarts.",
        "operationId": "call_set_caller_v1_call__call_id__caller_post",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Call Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallerUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveCallStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/call/{call_id}/chunk": {
      "post": {
        "summary": "Call Chunk",
        "description": "Feed a transcript utterance; returns the rolling deterministic verdict.\nFast path only (rules + claims vs caller ID) — safe to call per utterance.",
        "operationId": "call_chunk_v1_call__call_id__chunk_post",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Call Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallChunkRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveCallStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/call/{call_id}/assess": {
      "post": {
        "summary": "Call Assess",
        "description": "Mid-call LLM pass over the rolling transcript (redacted). Takes seconds —\nthe UI throttles this and keeps streaming fast /chunk updates meanwhile.",
        "operationId": "call_assess_v1_call__call_id__assess_post",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Call Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveCallStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/call/{call_id}/cancel": {
      "post": {
        "summary": "Call Cancel",
        "description": "Abandon a session WITHOUT analysis and purge its transcript immediately.\nCalled on page unload / user cancel so raw speech is never retained.",
        "operationId": "call_cancel_v1_call__call_id__cancel_post",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Call Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Call Cancel V1 Call  Call Id  Cancel Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/call/{call_id}/end": {
      "post": {
        "summary": "Call End",
        "description": "End the session and run the FULL pipeline (redact → rules → URLs → LLM →\nverification → persist) over the whole transcript for the final verdict.",
        "operationId": "call_end_v1_call__call_id__end_post",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Call Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyzeMessageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/llm/status": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Llm Status",
        "description": "Precisely why AI features are or are not available.\n\nExists because \"the server answered /api/tags\" was being reported as \"the AI\nworks\". If Ollama is up but the model was never pulled, the UI promised AI\nexplanations and then failed on every request — telling the user one thing\nand showing them another.",
        "operationId": "llm_status_v1_llm_status_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Llm Status V1 Llm Status Get"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat": {
      "post": {
        "summary": "Verdict Chat",
        "description": "Scam-advisor chat, grounded in sources of truth.\n\nStateless: the client resends context and prior turns. Verdict context is\noptional — users can ask about any incident they remember.\n\nTwo things make this safe to ship:\n· Everything the user types is redacted before it reaches the model.\n· Facts come from the entity registry, the cited alerts feed and community\n  reports — not the model's memory. A confabulated \"official\" bank phone\n  number is the worst failure this product could have, because the user\n  would call it.",
        "operationId": "verdict_chat_v1_chat_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/review/queue": {
      "get": {
        "summary": "Review Queue",
        "description": "Gray-zone verdicts awaiting a human decision. Contains metadata only —\nreviewers see signals (rules, domains, scores), never raw message content.",
        "operationId": "review_queue_v1_review_queue_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReviewQueueItem"
                  },
                  "title": "Response Review Queue V1 Review Queue Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/review/{analysis_id}/label": {
      "post": {
        "summary": "Label Analysis",
        "description": "Record a human verdict. These labels are the ground truth that tunes\nrules/weights over time — the feedback loop of the manual tier.",
        "operationId": "label_analysis_v1_review__analysis_id__label_post",
        "parameters": [
          {
            "name": "analysis_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Analysis Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Label Analysis V1 Review  Analysis Id  Label Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/caller/check": {
      "post": {
        "summary": "Caller Check",
        "description": "Check a number on its own, outside a call — optionally against the\norganisation the caller claimed (an id from the entity registry). Web\nlookups only with `online_checks` and where the operator enabled them.",
        "operationId": "caller_check_v1_caller_check_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallerCheckRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallerCheck"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/links/virustotal": {
      "post": {
        "tags": [
          "analysis"
        ],
        "summary": "Virustotal Check",
        "description": "Check one link against VirusTotal's ~90 scanners, when the user asks.\n\nSends the link to VirusTotal (a Google service), so it refuses without\n`consent: true` (safety invariant 4). Budgeted below the free API's limits\nfor the whole site. Informational only: it never changes a verdict, and\nno answer here calls a link safe.",
        "operationId": "virustotal_check_v1_links_virustotal_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VirusTotalRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VirusTotalResult"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/capabilities": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Capabilities",
        "description": "What this deployment can do — clients feature-detect instead of guessing.\n\nMobile apps call this on launch to decide whether to show AI explanations,\nvoice upload, or online-check consent toggles.",
        "operationId": "capabilities_v1_capabilities_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Capabilities V1 Capabilities Get"
                }
              }
            }
          }
        }
      }
    },
    "/v1/health": {
      "get": {
        "summary": "Health",
        "operationId": "health_v1_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Health V1 Health Get"
                }
              }
            }
          }
        }
      }
    },
    "/v1/report": {
      "post": {
        "tags": [
          "community"
        ],
        "summary": "Submit Report",
        "description": "Submit an anonymous scam report.\n\nOnly `description` is required. Everything else is optional because a real\nreporter rarely has the full picture, and a form that insists on it collects\nnothing at all.",
        "operationId": "submit_report_v1_report_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/alerts": {
      "get": {
        "tags": [
          "community"
        ],
        "summary": "Alerts",
        "description": "Current scam campaigns, newest first.\n\nEach alert links to a primary source. Alerts without one are not published —\nan unsourced warning is a rumour, and this product's value is being the\nthing people can trust.",
        "operationId": "alerts_v1_alerts_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 8
                },
                {
                  "type": "null"
                }
              ],
              "title": "Region"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/feedback": {
      "post": {
        "tags": [
          "community"
        ],
        "summary": "Verdict Feedback",
        "description": "Anonymous \"this verdict looks wrong\".\n\nSeparate from `POST /v1/review/{id}/label` on purpose. That endpoint sets\nground truth and is authenticated; the web UI used to post straight into it,\nwhich meant anonymous visitors could write ground truth whenever auth was\noff, and the button broke outright when auth was on. Public feedback is a\nsignal that something deserves a reviewer's attention — not the verdict\nitself.",
        "operationId": "verdict_feedback_v1_feedback_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerdictFeedbackRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerdictFeedbackResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AlertItem": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "summary": {
            "type": "string",
            "title": "Summary"
          },
          "category": {
            "type": "string",
            "title": "Category"
          },
          "severity": {
            "type": "string",
            "title": "Severity"
          },
          "regions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Regions"
          },
          "source_name": {
            "type": "string",
            "title": "Source Name"
          },
          "source_url": {
            "type": "string",
            "title": "Source Url"
          },
          "published_at": {
            "type": "string",
            "title": "Published At"
          },
          "is_fixture": {
            "type": "boolean",
            "title": "Is Fixture",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "summary",
          "category",
          "severity",
          "source_name",
          "source_url",
          "published_at"
        ],
        "title": "AlertItem",
        "description": "A current scam campaign. Every alert cites a primary source."
      },
      "AlertsResponse": {
        "properties": {
          "alerts": {
            "items": {
              "$ref": "#/components/schemas/AlertItem"
            },
            "type": "array",
            "title": "Alerts"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          },
          "is_fixture_feed": {
            "type": "boolean",
            "title": "Is Fixture Feed",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "alerts",
          "count"
        ],
        "title": "AlertsResponse"
      },
      "AnalyzeMessageRequest": {
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 20000,
            "minLength": 1,
            "title": "Text"
          },
          "source_type": {
            "$ref": "#/components/schemas/SourceType"
          },
          "source_app": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Source App"
          },
          "sender": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sender"
          },
          "locale": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Locale",
            "description": "e.g. en-AE, ar-AE"
          },
          "user_consent_cloud_ai": {
            "type": "boolean",
            "title": "User Consent Cloud Ai",
            "default": false
          },
          "user_consent_online_checks": {
            "type": "boolean",
            "title": "User Consent Online Checks",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "text",
          "source_type",
          "source_app"
        ],
        "title": "AnalyzeMessageRequest"
      },
      "AnalyzeMessageResponse": {
        "properties": {
          "analysis_id": {
            "type": "string",
            "title": "Analysis Id"
          },
          "risk_score": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Risk Score"
          },
          "risk_level": {
            "$ref": "#/components/schemas/RiskLevel"
          },
          "category": {
            "$ref": "#/components/schemas/ScamCategory"
          },
          "explanation": {
            "type": "string",
            "title": "Explanation"
          },
          "recommended_action": {
            "type": "string",
            "title": "Recommended Action"
          },
          "matched_rules": {
            "items": {
              "$ref": "#/components/schemas/MatchedRule"
            },
            "type": "array",
            "title": "Matched Rules"
          },
          "urls": {
            "items": {
              "$ref": "#/components/schemas/UrlFinding"
            },
            "type": "array",
            "title": "Urls"
          },
          "scores": {
            "$ref": "#/components/schemas/ScoreBreakdown"
          },
          "llm_verdict": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LLMVerdict"
              },
              {
                "type": "null"
              }
            ]
          },
          "verification": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VerificationReport"
              },
              {
                "type": "null"
              }
            ]
          },
          "review_status": {
            "$ref": "#/components/schemas/ReviewStatus",
            "default": "auto"
          },
          "redaction_applied": {
            "type": "boolean",
            "title": "Redaction Applied"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "detected_language": {
            "type": "string",
            "title": "Detected Language",
            "default": "en"
          },
          "coverage": {
            "type": "string",
            "title": "Coverage",
            "default": "full"
          },
          "coverage_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coverage Note"
          },
          "processing": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProcessingDisclosure"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "analysis_id",
          "risk_score",
          "risk_level",
          "category",
          "explanation",
          "recommended_action",
          "matched_rules",
          "urls",
          "scores",
          "redaction_applied",
          "created_at"
        ],
        "title": "AnalyzeMessageResponse"
      },
      "BatchAnalyzeItem": {
        "properties": {
          "index": {
            "type": "integer",
            "title": "Index"
          },
          "analysis": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnalyzeMessageResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "index"
        ],
        "title": "BatchAnalyzeItem"
      },
      "BatchAnalyzeRequest": {
        "properties": {
          "messages": {
            "items": {
              "$ref": "#/components/schemas/AnalyzeMessageRequest"
            },
            "type": "array",
            "maxItems": 50,
            "minItems": 1,
            "title": "Messages"
          }
        },
        "type": "object",
        "required": [
          "messages"
        ],
        "title": "BatchAnalyzeRequest",
        "description": "Analyze several messages in one round trip.\n\nMobile SMS-filter extensions are given very little time and battery per\nmessage; batching lets a client flush a queue in a single request instead of\nN round trips. Each item is analyzed independently — no shared context."
      },
      "BatchAnalyzeResponse": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/BatchAnalyzeItem"
            },
            "type": "array",
            "title": "Results"
          }
        },
        "type": "object",
        "required": [
          "results"
        ],
        "title": "BatchAnalyzeResponse"
      },
      "Body_analyze_voice_v1_analyze_voice_post": {
        "properties": {
          "file": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File"
          },
          "sender": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sender"
          },
          "locale": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Locale"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_analyze_voice_v1_analyze_voice_post"
      },
      "CallChunkRequest": {
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 4000,
            "minLength": 1,
            "title": "Text"
          },
          "commit": {
            "type": "boolean",
            "title": "Commit",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "text"
        ],
        "title": "CallChunkRequest"
      },
      "CallStartRequest": {
        "properties": {
          "caller_id": {
            "type": "string",
            "maxLength": 32,
            "minLength": 1,
            "title": "Caller Id"
          },
          "locale": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Locale"
          },
          "online_checks": {
            "type": "boolean",
            "title": "Online Checks",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "caller_id"
        ],
        "title": "CallStartRequest",
        "description": "Begin a live-call session. caller_id is the incoming number/ID shown\nto the user — it is compared against the caller's *claims* as they talk."
      },
      "CallStartResponse": {
        "properties": {
          "call_id": {
            "type": "string",
            "title": "Call Id"
          }
        },
        "type": "object",
        "required": [
          "call_id"
        ],
        "title": "CallStartResponse"
      },
      "CallerCheck": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "number": {
            "type": "string",
            "title": "Number",
            "default": ""
          },
          "number_kind": {
            "type": "string",
            "title": "Number Kind",
            "default": ""
          },
          "claimed_entity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Claimed Entity"
          },
          "verdict": {
            "type": "string",
            "title": "Verdict",
            "default": "no_number"
          },
          "headline": {
            "type": "string",
            "title": "Headline",
            "default": ""
          },
          "evidence": {
            "items": {
              "$ref": "#/components/schemas/CallerEvidence"
            },
            "type": "array",
            "title": "Evidence"
          },
          "external_lookups": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "External Lookups"
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "CallerCheck",
        "description": "Does the number calling you belong to who the caller says they are?\n\nverdict:\n  reported      people have reported this number as a scam\n  not_official  the caller claims an organisation and this is not one of its numbers\n  wrong_kind    the caller claims a bank or government office from a mobile or a foreign number\n  official      the number is listed by the claimed organisation — caller ID can be\n                faked, so this NEVER lowers the risk\n  unverified    claimed, and nothing confirms or contradicts it yet\n  no_record     no claim yet, and nothing known about the number\n  no_number     nothing to check (withheld or not typed)"
      },
      "CallerCheckRequest": {
        "properties": {
          "caller_id": {
            "type": "string",
            "maxLength": 32,
            "minLength": 1,
            "title": "Caller Id"
          },
          "claimed_entity": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "title": "Claimed Entity",
            "description": "entity id from known_entities.yaml, e.g. emirates_nbd"
          },
          "online_checks": {
            "type": "boolean",
            "title": "Online Checks",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "caller_id"
        ],
        "title": "CallerCheckRequest"
      },
      "CallerEvidence": {
        "properties": {
          "source": {
            "type": "string",
            "title": "Source"
          },
          "outcome": {
            "type": "string",
            "title": "Outcome"
          },
          "detail": {
            "type": "string",
            "title": "Detail"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          }
        },
        "type": "object",
        "required": [
          "source",
          "outcome",
          "detail"
        ],
        "title": "CallerEvidence",
        "description": "One finding from one agent of the caller check. Evidence, not a verdict."
      },
      "CallerUpdateRequest": {
        "properties": {
          "caller_id": {
            "type": "string",
            "maxLength": 32,
            "minLength": 1,
            "title": "Caller Id"
          },
          "online_checks": {
            "type": "boolean",
            "title": "Online Checks",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "caller_id"
        ],
        "title": "CallerUpdateRequest",
        "description": "Type or correct the number mid-call."
      },
      "ChatMessage": {
        "properties": {
          "role": {
            "type": "string",
            "pattern": "^(user|assistant)$",
            "title": "Role"
          },
          "content": {
            "type": "string",
            "maxLength": 4000,
            "minLength": 1,
            "title": "Content"
          }
        },
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "title": "ChatMessage"
      },
      "ChatRequest": {
        "properties": {
          "question": {
            "type": "string",
            "maxLength": 2000,
            "minLength": 1,
            "title": "Question"
          },
          "message_text": {
            "type": "string",
            "maxLength": 20000,
            "title": "Message Text",
            "default": ""
          },
          "verdict_summary": {
            "type": "string",
            "maxLength": 8000,
            "title": "Verdict Summary",
            "default": ""
          },
          "history": {
            "items": {
              "$ref": "#/components/schemas/ChatMessage"
            },
            "type": "array",
            "maxItems": 20,
            "title": "History"
          }
        },
        "type": "object",
        "required": [
          "question"
        ],
        "title": "ChatRequest",
        "description": "Scam-advisor Q&A. Context fields are optional: with them the chat is\nanchored to an analyzed verdict; without them the user can describe any\nother incident they remember. Server redacts before anything reaches the LLM."
      },
      "ChatResponse": {
        "properties": {
          "answer": {
            "type": "string",
            "title": "Answer"
          },
          "llm_used": {
            "type": "boolean",
            "title": "Llm Used"
          },
          "llm_state": {
            "type": "string",
            "title": "Llm State",
            "default": "ready"
          },
          "citations": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Citations"
          },
          "grounded": {
            "type": "boolean",
            "title": "Grounded",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "answer",
          "llm_used"
        ],
        "title": "ChatResponse"
      },
      "ClaimStatus": {
        "type": "string",
        "enum": [
          "verified",
          "unverified",
          "contradicted",
          "mention"
        ],
        "title": "ClaimStatus"
      },
      "EntityClaim": {
        "properties": {
          "entity_id": {
            "type": "string",
            "title": "Entity Id"
          },
          "entity_name": {
            "type": "string",
            "title": "Entity Name"
          },
          "category": {
            "$ref": "#/components/schemas/ScamCategory"
          },
          "status": {
            "$ref": "#/components/schemas/ClaimStatus"
          },
          "evidence": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Evidence"
          },
          "is_claim": {
            "type": "boolean",
            "title": "Is Claim",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "entity_id",
          "entity_name",
          "category",
          "status"
        ],
        "title": "EntityClaim"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "IndicatorPayload": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "value": {
            "type": "string",
            "title": "Value"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "confidence": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Confidence"
          },
          "regions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Regions"
          },
          "campaign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Campaign"
          },
          "added_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Added At"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "notes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Notes"
          }
        },
        "type": "object",
        "required": [
          "id",
          "kind",
          "value",
          "source",
          "confidence"
        ],
        "title": "IndicatorPayload",
        "description": "One piece of syncable threat knowledge, with its provenance."
      },
      "LLMVerdict": {
        "properties": {
          "is_scam": {
            "type": "boolean",
            "title": "Is Scam"
          },
          "confidence": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Confidence"
          },
          "category": {
            "$ref": "#/components/schemas/ScamCategory"
          },
          "reasoning": {
            "type": "string",
            "maxLength": 1000,
            "title": "Reasoning"
          },
          "red_flags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 10,
            "title": "Red Flags"
          },
          "recommended_action": {
            "type": "string",
            "maxLength": 300,
            "title": "Recommended Action"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "is_scam",
          "confidence",
          "category",
          "reasoning",
          "recommended_action"
        ],
        "title": "LLMVerdict",
        "description": "Schema the local LLM MUST return. Passed to Ollama as a JSON-schema `format` constraint."
      },
      "ListedBy": {
        "properties": {
          "source": {
            "type": "string",
            "title": "Source"
          },
          "match": {
            "type": "string",
            "title": "Match"
          },
          "list_updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "List Updated At"
          }
        },
        "type": "object",
        "required": [
          "source",
          "match",
          "list_updated_at"
        ],
        "title": "ListedBy",
        "description": "A downloaded link list that names this URL (or its whole site)."
      },
      "LiveCallStatus": {
        "properties": {
          "call_id": {
            "type": "string",
            "title": "Call Id"
          },
          "risk_score": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Risk Score"
          },
          "risk_level": {
            "$ref": "#/components/schemas/RiskLevel"
          },
          "category": {
            "$ref": "#/components/schemas/ScamCategory"
          },
          "should_warn": {
            "type": "boolean",
            "title": "Should Warn"
          },
          "alerts": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Alerts"
          },
          "claims": {
            "items": {
              "$ref": "#/components/schemas/EntityClaim"
            },
            "type": "array",
            "title": "Claims"
          },
          "matched_rules": {
            "items": {
              "$ref": "#/components/schemas/MatchedRule"
            },
            "type": "array",
            "title": "Matched Rules"
          },
          "transcript_chars": {
            "type": "integer",
            "title": "Transcript Chars",
            "default": 0
          },
          "llm_score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Llm Score"
          },
          "llm_reasoning": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Llm Reasoning"
          },
          "caller_check": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CallerCheck"
              },
              {
                "type": "null"
              }
            ]
          },
          "alert_level": {
            "type": "string",
            "title": "Alert Level",
            "default": "none"
          },
          "severity": {
            "type": "string",
            "title": "Severity",
            "default": "none"
          },
          "coverage": {
            "type": "string",
            "title": "Coverage",
            "default": "full"
          },
          "coverage_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coverage Note"
          }
        },
        "type": "object",
        "required": [
          "call_id",
          "risk_score",
          "risk_level",
          "category",
          "should_warn"
        ],
        "title": "LiveCallStatus",
        "description": "Incremental verdict over the accumulated transcript. Deterministic only\n(rules + entity claims vs caller ID) so it is fast enough per utterance."
      },
      "MatchedRule": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "category": {
            "$ref": "#/components/schemas/ScamCategory"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "weight": {
            "type": "number",
            "title": "Weight"
          }
        },
        "type": "object",
        "required": [
          "id",
          "category",
          "description",
          "weight"
        ],
        "title": "MatchedRule"
      },
      "PackDeltaResponse": {
        "properties": {
          "from_serial": {
            "type": "integer",
            "title": "From Serial"
          },
          "to_serial": {
            "type": "integer",
            "title": "To Serial"
          },
          "full_resync_required": {
            "type": "boolean",
            "title": "Full Resync Required"
          },
          "added_indicators": {
            "items": {
              "$ref": "#/components/schemas/IndicatorPayload"
            },
            "type": "array",
            "title": "Added Indicators"
          },
          "removed_indicator_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Removed Indicator Ids"
          },
          "rules_changed": {
            "type": "boolean",
            "title": "Rules Changed",
            "default": false
          },
          "entities_changed": {
            "type": "boolean",
            "title": "Entities Changed",
            "default": false
          },
          "scoring_changed": {
            "type": "boolean",
            "title": "Scoring Changed",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "from_serial",
          "to_serial",
          "full_resync_required"
        ],
        "title": "PackDeltaResponse",
        "description": "Incremental update for a device already holding an older serial."
      },
      "ProcessingDisclosure": {
        "properties": {
          "local_stages": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Local Stages"
          },
          "external_stages": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "External Stages"
          },
          "external_consented": {
            "type": "boolean",
            "title": "External Consented",
            "default": false
          },
          "notes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Notes"
          }
        },
        "type": "object",
        "title": "ProcessingDisclosure",
        "description": "What actually ran, and where. Lets the UI tell the truth about privacy\ninstead of a blanket 'local-first' claim."
      },
      "ReportRequest": {
        "properties": {
          "description": {
            "type": "string",
            "maxLength": 5000,
            "minLength": 10,
            "title": "Description"
          },
          "website": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Website"
          },
          "person_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Person Name"
          },
          "organisation": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Organisation"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 320
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "bank_sort_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Bank Sort Code"
          },
          "bank_account": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ],
            "title": "Bank Account"
          },
          "occurred_on": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ],
            "title": "Occurred On"
          },
          "location": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Location"
          },
          "channel": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ],
            "title": "Channel"
          },
          "amount_lost": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Lost"
          }
        },
        "type": "object",
        "required": [
          "description"
        ],
        "title": "ReportRequest",
        "description": "An anonymous scam report.\n\nOnly `description` is required. A reporter almost never has every detail,\nand a form that demands them collects nothing at all."
      },
      "ReportResponse": {
        "properties": {
          "report_id": {
            "type": "string",
            "title": "Report Id"
          },
          "received": {
            "type": "boolean",
            "title": "Received"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "analysis_preview": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Analysis Preview"
          }
        },
        "type": "object",
        "required": [
          "report_id",
          "received",
          "message"
        ],
        "title": "ReportResponse"
      },
      "ReviewLabel": {
        "type": "string",
        "enum": [
          "scam",
          "legitimate",
          "unsure"
        ],
        "title": "ReviewLabel"
      },
      "ReviewQueueItem": {
        "properties": {
          "analysis_id": {
            "type": "string",
            "title": "Analysis Id"
          },
          "risk_score": {
            "type": "number",
            "title": "Risk Score"
          },
          "risk_level": {
            "$ref": "#/components/schemas/RiskLevel"
          },
          "category": {
            "$ref": "#/components/schemas/ScamCategory"
          },
          "matched_rule_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Matched Rule Ids"
          },
          "extracted_domains": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Extracted Domains"
          },
          "source_type": {
            "type": "string",
            "title": "Source Type"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "analysis_id",
          "risk_score",
          "risk_level",
          "category",
          "matched_rule_ids",
          "extracted_domains",
          "source_type",
          "created_at"
        ],
        "title": "ReviewQueueItem"
      },
      "ReviewRequest": {
        "properties": {
          "label": {
            "$ref": "#/components/schemas/ReviewLabel"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          }
        },
        "type": "object",
        "required": [
          "label"
        ],
        "title": "ReviewRequest"
      },
      "ReviewStatus": {
        "type": "string",
        "enum": [
          "auto",
          "needs_review",
          "reviewed"
        ],
        "title": "ReviewStatus"
      },
      "RiskLevel": {
        "type": "string",
        "enum": [
          "safe",
          "suspicious",
          "likely_scam",
          "scam"
        ],
        "title": "RiskLevel"
      },
      "RulesPackResponse": {
        "properties": {
          "rules_version": {
            "type": "string",
            "title": "Rules Version"
          },
          "entities_version": {
            "type": "string",
            "title": "Entities Version"
          },
          "serial": {
            "type": "integer",
            "title": "Serial",
            "default": 0
          },
          "rules": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Rules"
          },
          "entities": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Entities"
          },
          "indicators": {
            "items": {
              "$ref": "#/components/schemas/IndicatorPayload"
            },
            "type": "array",
            "title": "Indicators"
          },
          "scoring": {
            "additionalProperties": true,
            "type": "object",
            "title": "Scoring"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At"
          },
          "signature": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signature"
          }
        },
        "type": "object",
        "required": [
          "rules_version",
          "entities_version",
          "rules",
          "entities",
          "scoring",
          "generated_at"
        ],
        "title": "RulesPackResponse",
        "description": "The deterministic tier, shipped to clients for OFFLINE/on-device checks.\n\niOS SMS filter extensions must answer without network access, so the client\nruns these regexes locally and only calls the API for the richer tiers.\nClients send If-None-Match / `since_version` and get 304 when unchanged."
      },
      "ScamCategory": {
        "type": "string",
        "enum": [
          "bank_impersonation",
          "government_impersonation",
          "delivery_scam",
          "otp_phishing",
          "remote_access",
          "investment_crypto",
          "prize_lottery",
          "job_scam",
          "romance",
          "phishing_generic",
          "none"
        ],
        "title": "ScamCategory"
      },
      "ScoreBreakdown": {
        "properties": {
          "rule_score": {
            "type": "number",
            "title": "Rule Score"
          },
          "url_score": {
            "type": "number",
            "title": "Url Score"
          },
          "llm_score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Llm Score"
          },
          "llm_used": {
            "type": "boolean",
            "title": "Llm Used"
          }
        },
        "type": "object",
        "required": [
          "rule_score",
          "url_score",
          "llm_used"
        ],
        "title": "ScoreBreakdown"
      },
      "SourceType": {
        "type": "string",
        "enum": [
          "sms",
          "email",
          "chat",
          "call_transcript",
          "social",
          "other"
        ],
        "title": "SourceType"
      },
      "UrlFinding": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url"
          },
          "domain": {
            "type": "string",
            "title": "Domain"
          },
          "suspicious": {
            "type": "boolean",
            "title": "Suspicious"
          },
          "reasons": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Reasons"
          },
          "score": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Score"
          },
          "listed_by": {
            "items": {
              "$ref": "#/components/schemas/ListedBy"
            },
            "type": "array",
            "title": "Listed By"
          }
        },
        "type": "object",
        "required": [
          "url",
          "domain",
          "suspicious",
          "score"
        ],
        "title": "UrlFinding"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "VerdictFeedbackRequest": {
        "properties": {
          "analysis_id": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1,
            "title": "Analysis Id"
          },
          "expected": {
            "type": "string",
            "pattern": "^(scam|legitimate|unsure)$",
            "title": "Expected"
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "shared_text": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20000
              },
              {
                "type": "null"
              }
            ],
            "title": "Shared Text"
          },
          "share_consent": {
            "type": "boolean",
            "title": "Share Consent",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "analysis_id",
          "expected"
        ],
        "title": "VerdictFeedbackRequest",
        "description": "Anonymous \"this verdict looks wrong\".\n\nDeliberately separate from the human-review ground-truth endpoint: public\nfeedback is a signal that something deserves review, not an authority to\nset ground truth. See app/community/store.py."
      },
      "VerdictFeedbackResponse": {
        "properties": {
          "received": {
            "type": "boolean",
            "title": "Received"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "received",
          "message"
        ],
        "title": "VerdictFeedbackResponse"
      },
      "VerificationReport": {
        "properties": {
          "claims": {
            "items": {
              "$ref": "#/components/schemas/EntityClaim"
            },
            "type": "array",
            "title": "Claims"
          },
          "web_findings": {
            "items": {
              "$ref": "#/components/schemas/WebIntelFinding"
            },
            "type": "array",
            "title": "Web Findings"
          },
          "domain_ages": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Domain Ages"
          },
          "score_adjustment": {
            "type": "number",
            "title": "Score Adjustment",
            "default": 0.0
          },
          "notes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Notes"
          }
        },
        "type": "object",
        "title": "VerificationReport"
      },
      "VirusTotalRequest": {
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "minLength": 1,
            "title": "Url"
          },
          "consent": {
            "type": "boolean",
            "title": "Consent",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "VirusTotalRequest",
        "description": "Check one link with VirusTotal. Sends the link to VirusTotal (a Google\nservice), so `consent` must be true: ask the user first."
      },
      "VirusTotalResult": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "malicious": {
            "type": "integer",
            "title": "Malicious",
            "default": 0
          },
          "suspicious": {
            "type": "integer",
            "title": "Suspicious",
            "default": 0
          },
          "harmless": {
            "type": "integer",
            "title": "Harmless",
            "default": 0
          },
          "undetected": {
            "type": "integer",
            "title": "Undetected",
            "default": 0
          },
          "analysed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Analysed At"
          },
          "report_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Report Url"
          },
          "sent_to": {
            "type": "string",
            "title": "Sent To",
            "default": "VirusTotal"
          }
        },
        "type": "object",
        "required": [
          "status",
          "url",
          "message"
        ],
        "title": "VirusTotalResult"
      },
      "VoiceAnalyzeResponse": {
        "properties": {
          "transcript": {
            "type": "string",
            "title": "Transcript"
          },
          "analysis": {
            "$ref": "#/components/schemas/AnalyzeMessageResponse"
          }
        },
        "type": "object",
        "required": [
          "transcript",
          "analysis"
        ],
        "title": "VoiceAnalyzeResponse"
      },
      "WebIntelFinding": {
        "properties": {
          "subject": {
            "type": "string",
            "title": "Subject"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "checked": {
            "type": "boolean",
            "title": "Checked"
          },
          "reports_found": {
            "type": "integer",
            "title": "Reports Found",
            "default": 0
          },
          "snippets": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Snippets"
          }
        },
        "type": "object",
        "required": [
          "subject",
          "kind",
          "checked"
        ],
        "title": "WebIntelFinding"
      }
    }
  },
  "tags": [
    {
      "name": "analysis",
      "description": "Message, batch and voice analysis"
    },
    {
      "name": "live-call",
      "description": "Real-time call session analysis"
    },
    {
      "name": "sync",
      "description": "On-device rules pack for offline checks"
    },
    {
      "name": "review",
      "description": "Human review queue (auth when configured)"
    },
    {
      "name": "system",
      "description": "Health and capabilities"
    }
  ],
  "servers": [
    {
      "url": "https://defai.austriaeast.cloudapp.azure.com",
      "description": "Production"
    }
  ]
}
