{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/infinihash-com/json-schema/infinihash-com-doc-smart-extract-result-schema.json",
  "title": "DocSmartExtractResult",
  "description": "Single-document mode returns extracted/provider/served_by/... (plus entityId/entityName/entityType when createEntity created a submission); bundle mode returns mode/segments/mrz/mrzAlert/summary.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kyc-api-infinihash-openapi.json#/components/schemas/DocSmartExtractResult",
  "type": "object",
  "properties": {
    "extracted": {
      "type": "object",
      "additionalProperties": true,
      "description": "Entity fields (name, entityType, country, officers[], owners[], signatory, ...). Empty with `warning` when the model is unavailable: fill manually."
    },
    "provider": {
      "type": "string"
    },
    "served_by": {
      "type": "string"
    },
    "warning": {
      "type": "string"
    },
    "discrepancies": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "pages_extracted": {
      "type": "integer"
    },
    "pipeline": {
      "type": "string"
    },
    "extraction_warnings": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "doc_plan": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true,
      "description": "Required documents plan (entity docs, per-person ID docs, conditional docs)."
    },
    "entityId": {
      "type": "string",
      "description": "Present when createEntity created a submission."
    },
    "entityName": {
      "type": "string"
    },
    "entityType": {
      "type": "string"
    },
    "mode": {
      "type": "string",
      "enum": [
        "bundle"
      ],
      "description": "Bundle mode only."
    },
    "segments": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DocBundleSegment"
      }
    },
    "mrz": {
      "type": "object",
      "additionalProperties": true,
      "description": "Bundle mode: MRZ cross-check of the ID/passport segment."
    },
    "mrzAlert": {
      "type": "boolean",
      "description": "Bundle mode only."
    },
    "summary": {
      "type": "object",
      "properties": {
        "totalSegments": {
          "type": "integer"
        },
        "docTypes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "hasCIS": {
          "type": "boolean"
        },
        "mrzChecked": {
          "type": "boolean"
        },
        "mrzAlert": {
          "type": "boolean"
        }
      }
    }
  },
  "$defs": {
    "DocBundleSegment": {
      "type": "object",
      "properties": {
        "segmentIdx": {
          "type": "integer"
        },
        "docType": {
          "type": "string"
        },
        "pages": {
          "description": "Page range or list covered by the segment."
        },
        "confidence": {
          "type": "number"
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "extracted": {
          "type": "object",
          "additionalProperties": true
        },
        "provider": {
          "type": "string"
        }
      }
    }
  }
}