{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/withverifa-com/json-schema/withverifa-com-consortium-match-schema.json",
  "title": "ConsortiumMatch",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/withverifa-com-openapi.yml#/components/schemas/ConsortiumMatch",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "consortium_id": {
      "type": "string"
    },
    "match_type": {
      "$ref": "#/$defs/ConsortiumMatchMatchType"
    },
    "face_similarity_score": {
      "type": [
        "number",
        "null"
      ],
      "format": "double",
      "description": "Cosine similarity between face embeddings (0–1)."
    },
    "name_mismatch": {
      "type": "boolean",
      "description": "True if the names on the two sessions differ."
    },
    "dob_mismatch": {
      "type": "boolean",
      "description": "True if the dates of birth differ."
    },
    "document_type_mismatch": {
      "type": "boolean"
    },
    "document_number_match": {
      "type": "boolean",
      "description": "True if the same document number appears at both orgs."
    },
    "email_match": {
      "type": "boolean"
    },
    "phone_match": {
      "type": "boolean"
    },
    "device_match": {
      "type": "boolean"
    },
    "days_between": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Days between the two sessions' creation dates."
    },
    "ghost_student_score": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Composite fraud risk score (0–100)."
    },
    "ghost_student_tier": {
      "$ref": "#/$defs/ConsortiumMatchGhostStudentTier",
      "description": "Risk tier derived from ghost_student_score."
    },
    "status": {
      "$ref": "#/$defs/ConsortiumMatchStatus"
    },
    "primary_session_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Present when sharing_level is \"match_details\" or higher."
    },
    "primary_org_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "matched_session_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "matched_org_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "primary_org_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "matched_org_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "investigated_by": {
      "type": [
        "string",
        "null"
      ]
    },
    "investigated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "resolution_notes": {
      "type": [
        "string",
        "null"
      ],
      "description": "Present when sharing_level is \"full_investigation\"."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "consortium_id",
    "match_type",
    "status",
    "created_at"
  ],
  "$defs": {
    "ConsortiumMatchGhostStudentTier": {
      "type": "string",
      "enum": [
        "pass",
        "monitor",
        "review",
        "hold"
      ],
      "description": "Risk tier derived from ghost_student_score.",
      "title": "ConsortiumMatchGhostStudentTier"
    },
    "ConsortiumMatchMatchType": {
      "type": "string",
      "enum": [
        "face",
        "document",
        "face_and_document"
      ],
      "title": "ConsortiumMatchMatchType"
    },
    "ConsortiumMatchStatus": {
      "type": "string",
      "enum": [
        "new",
        "under_investigation",
        "confirmed_fraud",
        "false_positive",
        "resolved"
      ],
      "title": "ConsortiumMatchStatus"
    }
  }
}