{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scale-ai/json-schema/scale-ai-parse-result-entity-schema.json",
  "title": "ParseResultEntity",
  "description": "Parse result response model representing a completed parse operation.",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scale-ai-document-understanding-openapi.yml#/components/schemas/ParseResultEntity",
  "properties": {
    "content": {
      "anyOf": [
        {
          "$ref": "#/$defs/ParseResultContent-Output"
        },
        {
          "type": "null"
        }
      ],
      "description": "Parsed files, returned only if requested"
    },
    "object": {
      "type": "string",
      "const": "parse_result",
      "title": "Object",
      "default": "parse_result"
    },
    "source_document_id": {
      "type": "string",
      "title": "Source Document Id",
      "description": "Source document ID that was parsed"
    },
    "engine": {
      "type": "string",
      "title": "Engine",
      "description": "Engine used for parsing"
    },
    "parse_metadata": {
      "$ref": "#/$defs/ParseResultMetadata",
      "description": "Parse result metadata"
    },
    "vector_store_metadata": {
      "anyOf": [
        {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ]
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Vector Store Metadata",
      "description": "Metadata to populate into the vector store to filter on when searching"
    },
    "parameters": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Parameters",
      "description": "Parameters used during parsing"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error",
      "description": "Error message if parsing had issues"
    },
    "processing_time_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Processing Time Ms",
      "description": "Processing time in milliseconds"
    },
    "id": {
      "type": "string",
      "title": "Id",
      "description": "ID of the entity"
    },
    "project_id": {
      "type": "string",
      "title": "Project Id",
      "description": "ID of the project"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At",
      "description": "When the parse result was created"
    }
  },
  "type": "object",
  "required": [
    "source_document_id",
    "engine",
    "parse_metadata",
    "id",
    "project_id",
    "created_at"
  ],
  "$defs": {
    "BoundingBox": {
      "properties": {
        "left": {
          "type": "number",
          "title": "Left",
          "description": "Left coordinate"
        },
        "top": {
          "type": "number",
          "title": "Top",
          "description": "Top coordinate"
        },
        "width": {
          "type": "number",
          "title": "Width",
          "description": "Width"
        },
        "height": {
          "type": "number",
          "title": "Height",
          "description": "Height"
        }
      },
      "type": "object",
      "required": [
        "left",
        "top",
        "width",
        "height"
      ],
      "title": "BoundingBox",
      "description": "Bounding box information for location in document."
    },
    "ParseBlock": {
      "properties": {
        "type": {
          "type": "string",
          "title": "Type",
          "description": "Block type (text, table, figure, header, etc.)"
        },
        "content": {
          "type": "string",
          "title": "Content",
          "description": "The actual content (text, HTML, etc.)"
        },
        "bbox": {
          "$ref": "#/$defs/BoundingBox",
          "description": "Bounding box locations for this block"
        },
        "confidence": {
          "type": "number",
          "title": "Confidence",
          "description": "Confidence score (0-1)"
        },
        "page_number": {
          "type": "integer",
          "title": "Page Number",
          "description": "Page number on the document",
          "default": 0
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error",
          "description": "Per-region OCR error string when the model could not extract content (e.g. 'IRIS-ERROR: blank image', 'HTTP-ERROR: soft-timeout 60s exceeded'). None when the region was processed successfully (including the legitimate case of an empty region with no text to extract)."
        },
        "row_bboxes": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/BoundingBox"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Row Bboxes",
          "description": "Per-row bounding boxes for a table block, normalized to the full page like `bbox`. Populated by table substructure recognition; None otherwise."
        },
        "col_bboxes": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/BoundingBox"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Col Bboxes",
          "description": "Per-column bounding boxes for a table block, normalized to the full page like `bbox`. Populated by table substructure recognition; None otherwise."
        }
      },
      "type": "object",
      "required": [
        "type",
        "content",
        "bbox",
        "confidence"
      ],
      "title": "ParseBlock",
      "description": "A block of content from parsing with location information."
    },
    "ParseChunk-Output": {
      "properties": {
        "content": {
          "type": "string",
          "title": "Content",
          "description": "The actual content (text, HTML, etc.)"
        },
        "blocks": {
          "items": {
            "$ref": "#/$defs/ParseBlock"
          },
          "type": "array",
          "title": "Blocks",
          "description": "Blocks within this chunk"
        }
      },
      "type": "object",
      "required": [
        "content",
        "blocks"
      ],
      "title": "ParseChunk",
      "description": "A chunk containing one or more blocks."
    },
    "ParseResultContent-Output": {
      "properties": {
        "chunks": {
          "items": {
            "$ref": "#/$defs/ParseChunk-Output"
          },
          "type": "array",
          "title": "Chunks",
          "description": "Array of chunks from parsing"
        }
      },
      "type": "object",
      "required": [
        "chunks"
      ],
      "title": "ParseResultContent",
      "description": "Content for a parse result."
    },
    "ParseResultMetadata": {
      "properties": {
        "source_id": {
          "type": "string",
          "title": "Source Id",
          "description": "Source file ID"
        },
        "filename": {
          "type": "string",
          "title": "Filename",
          "description": "Original filename"
        },
        "pages_processed": {
          "type": "integer",
          "title": "Pages Processed",
          "description": "Number of pages actually processed"
        }
      },
      "type": "object",
      "required": [
        "source_id",
        "filename",
        "pages_processed"
      ],
      "title": "ParseResultMetadata",
      "description": "Metadata for a parse result."
    }
  }
}