{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.firstmilelabs.com/schemas/webhooks/screening.hit.detected.v1.json",
  "title": "FirstMileLabs Outbound Webhook — screening.hit.detected (v1)",
  "description": "Emitted once per genuinely-new sanctions / PEP screening hit. Fires when a hit is first persisted during onboarding screening AND when ComplyAdvantage native ongoing monitoring surfaces a hit after onboarding (distinguished by the `source` field). Carries the per-hit detail an analyst sees in the screening console so a CRM can review the hit without a second API call. Pair with screening.hit.triaged for the AI disposition.",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "event",
    "eventId",
    "eventVersion",
    "timestamp",
    "orgId",
    "caseId",
    "hitId",
    "source"
  ],
  "properties": {
    "event": { "type": "string", "const": "screening.hit.detected" },
    "eventId": { "type": "string", "format": "uuid" },
    "eventVersion": { "type": "integer", "const": 1 },
    "timestamp": { "type": "string", "format": "date-time" },
    "orgId": { "type": "string" },
    "crmRecordId": { "type": ["string", "null"], "description": "External CRM record id echoed from the case (e.g. Salesforce Account id)." },
    "crmSource": { "type": ["string", "null"], "description": "Originating CRM/iPaaS, lower-cased (e.g. \"salesforce\", \"hubspot\"). Null when the case has no CRM origin." },
    "caseId": { "type": "string" },
    "hitId": { "type": "string", "description": "Stable per-hit id. For OpenSanctions this is the vendor entity id; for ComplyAdvantage it is a derived `ca:<slug>` id. Use (caseId, hitId) to record a disposition via POST /v1/cases/{caseId}/screening/disposition." },
    "subjectId": { "type": ["string", "null"], "description": "The screened subject's id within the case roster. Null for monitoring-sourced hits." },
    "subjectName": { "type": ["string", "null"], "description": "The screened party (the customer's director/UBO/company), NOT the matched watchlist entity." },
    "subjectRole": { "type": ["string", "null"], "description": "e.g. \"director\", \"ubo\", \"company\". Null when unknown." },
    "caption": { "type": ["string", "null"], "description": "The matched watchlist entity's name/caption." },
    "schema": { "type": ["string", "null"], "description": "Entity type of the match, e.g. \"Person\" or \"Company\"." },
    "score": { "type": ["number", "null"], "description": "Match confidence score from the screening vendor." },
    "topics": { "type": "array", "items": { "type": "string" }, "description": "Topic/category tags on the match (e.g. \"sanction\", \"role.pep\", \"crime\")." },
    "position": { "type": "array", "items": { "type": "string" }, "description": "PEP positions held by the matched entity." },
    "nationality": { "type": "array", "items": { "type": "string" }, "description": "Nationalities of the matched entity." },
    "isPep": { "type": "boolean" },
    "isSanctioned": { "type": "boolean" },
    "source": { "type": "string", "enum": ["screening", "comply_advantage_native"], "description": "\"screening\" for an onboarding-time hit; \"comply_advantage_native\" for a post-onboarding ComplyAdvantage monitoring hit." }
  }
}
