{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-document-intelligence/json-schema/azure-document-intelligence-analyze-operation-result-schema.json",
  "title": "AnalyzeOperationResult",
  "description": "Status and result of the queued analyze operation.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/azure-document-intelligence-custom-api-openapi.yml#/components/schemas/AnalyzeOperationResult",
  "type": "object",
  "required": [
    "status",
    "createdDateTime",
    "lastUpdatedDateTime"
  ],
  "properties": {
    "status": {
      "description": "Operation status.",
      "$ref": "#/$defs/OperationStatus"
    },
    "createdDateTime": {
      "format": "date-time",
      "description": "Date and time (UTC) when the analyze operation was submitted.",
      "type": "string"
    },
    "lastUpdatedDateTime": {
      "format": "date-time",
      "description": "Date and time (UTC) when the status was last updated.",
      "type": "string"
    },
    "analyzeResult": {
      "description": "Results of the analyze operation.",
      "$ref": "#/$defs/AnalyzeResult"
    }
  },
  "$defs": {
    "AnalyzeResult": {
      "description": "Analyze operation result.",
      "type": "object",
      "required": [
        "version",
        "readResults"
      ],
      "properties": {
        "version": {
          "description": "Version of schema used for this result.",
          "type": "string"
        },
        "readResults": {
          "description": "Text extracted from the input.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReadResult"
          }
        },
        "pageResults": {
          "description": "Page-level information extracted from the input.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/PageResult"
          }
        },
        "documentResults": {
          "description": "Document-level information extracted from the input.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/DocumentResult"
          }
        },
        "errors": {
          "description": "List of errors reported during the analyze operation.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ErrorInformation"
          }
        }
      }
    },
    "Appearance": {
      "description": "An object representing the appearance of the text line.",
      "type": "object",
      "required": [
        "style"
      ],
      "properties": {
        "style": {
          "description": "An object representing the style of the text line.",
          "type": "object",
          "$ref": "#/$defs/Style"
        }
      }
    },
    "BoundingBox": {
      "description": "Quadrangle bounding box, with coordinates specified relative to the top-left of the original image. The eight numbers represent the four points, clockwise from the top-left corner relative to the text orientation. For image, the (x, y) coordinates are measured in pixels. For PDF, the (x, y) coordinates are measured in inches.",
      "type": "array",
      "minItems": 8,
      "maxItems": 8,
      "items": {
        "type": "number"
      }
    },
    "Confidence": {
      "description": "Confidence value.",
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "DataTable": {
      "description": "Information about the extracted table contained in a page.",
      "type": "object",
      "required": [
        "rows",
        "columns",
        "cells",
        "boundingBox"
      ],
      "properties": {
        "rows": {
          "description": "Number of rows.",
          "type": "integer",
          "minimum": 1
        },
        "columns": {
          "description": "Number of columns.",
          "type": "integer",
          "minimum": 1
        },
        "cells": {
          "description": "List of cells contained in the table.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/DataTableCell"
          }
        },
        "boundingBox": {
          "description": "Bounding box of the table.",
          "$ref": "#/$defs/BoundingBox"
        }
      }
    },
    "DataTableCell": {
      "description": "Information about the extracted cell in a table.",
      "type": "object",
      "required": [
        "rowIndex",
        "columnIndex",
        "text",
        "boundingBox",
        "confidence"
      ],
      "properties": {
        "rowIndex": {
          "description": "Row index of the cell.",
          "type": "integer",
          "minimum": 0
        },
        "columnIndex": {
          "description": "Column index of the cell.",
          "type": "integer",
          "minimum": 0
        },
        "rowSpan": {
          "description": "Number of rows spanned by this cell.",
          "type": "integer",
          "minimum": 1,
          "default": 1
        },
        "columnSpan": {
          "description": "Number of columns spanned by this cell.",
          "type": "integer",
          "minimum": 1,
          "default": 1
        },
        "text": {
          "description": "Text content of the cell.",
          "type": "string"
        },
        "boundingBox": {
          "description": "Bounding box of the cell.",
          "$ref": "#/$defs/BoundingBox"
        },
        "confidence": {
          "description": "Confidence value.",
          "$ref": "#/$defs/Confidence"
        },
        "elements": {
          "description": "When includeTextDetails is set to true, a list of references to the text elements constituting this table cell.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ElementReference"
          }
        },
        "isHeader": {
          "description": "Is the current cell a header cell?",
          "type": "boolean",
          "default": false
        },
        "isFooter": {
          "description": "Is the current cell a footer cell?",
          "type": "boolean",
          "default": false
        }
      }
    },
    "DocumentResult": {
      "description": "A set of extracted fields corresponding to the input document.",
      "type": "object",
      "required": [
        "docType",
        "pageRange",
        "fields"
      ],
      "properties": {
        "docType": {
          "description": "Document type.",
          "type": "string"
        },
        "modelId": {
          "description": "Model identifier.",
          "type": "string",
          "format": "uuid"
        },
        "pageRange": {
          "description": "First and last page number where the document is found.",
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": {
            "type": "integer",
            "minimum": 1
          }
        },
        "docTypeConfidence": {
          "description": "Predicted document type confidence.",
          "$ref": "#/$defs/Confidence"
        },
        "fields": {
          "description": "Dictionary of named field values.",
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/FieldValue"
          }
        }
      }
    },
    "ElementReference": {
      "description": "Reference to a line, word or selection mark.",
      "type": "string"
    },
    "ErrorInformation": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "FieldValue": {
      "description": "Recognized field value.",
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "description": "Type of field value.",
          "$ref": "#/$defs/FieldValueType"
        },
        "valueString": {
          "description": "String value.",
          "type": "string"
        },
        "valueDate": {
          "description": "Date value.",
          "format": "date",
          "type": "string"
        },
        "valueTime": {
          "description": "Time value.",
          "format": "time",
          "type": "string"
        },
        "valuePhoneNumber": {
          "description": "Phone number value.",
          "type": "string"
        },
        "valueNumber": {
          "description": "Floating point value.",
          "type": "number"
        },
        "valueInteger": {
          "description": "Integer value.",
          "type": "integer"
        },
        "valueArray": {
          "description": "Array of field values.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/FieldValue"
          }
        },
        "valueObject": {
          "description": "Dictionary of named field values.",
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/FieldValue"
          }
        },
        "valueSelectionMark": {
          "description": "Selection mark value.",
          "type": "string",
          "enum": [
            "selected",
            "unselected"
          ]
        },
        "valueCountryRegion": {
          "description": "3-letter country code (ISO 3166-1 alpha-3).",
          "type": "string"
        },
        "text": {
          "description": "Text content of the extracted field.",
          "type": "string"
        },
        "boundingBox": {
          "description": "Bounding box of the field value, if appropriate.",
          "$ref": "#/$defs/BoundingBox"
        },
        "confidence": {
          "description": "Confidence score.",
          "$ref": "#/$defs/Confidence"
        },
        "elements": {
          "description": "When includeTextDetails is set to true, a list of references to the text elements constituting this field.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ElementReference"
          }
        },
        "page": {
          "description": "The 1-based page number in the input document.",
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "FieldValueType": {
      "type": "string",
      "description": "Semantic data type of the field value.",
      "enum": [
        "string",
        "date",
        "time",
        "phoneNumber",
        "number",
        "integer",
        "array",
        "object",
        "selectionMark",
        "countryRegion"
      ],
      "x-ms-enum": {
        "name": "FieldValueType",
        "modelAsString": false
      }
    },
    "KeyValueElement": {
      "description": "Information about the extracted key or value in a key-value pair.",
      "type": "object",
      "required": [
        "text"
      ],
      "properties": {
        "type": {
          "$ref": "#/$defs/KeyValueType"
        },
        "text": {
          "description": "The text content of the key or value.",
          "type": "string"
        },
        "boundingBox": {
          "description": "Bounding box of the key or value.",
          "$ref": "#/$defs/BoundingBox"
        },
        "elements": {
          "description": "When includeTextDetails is set to true, a list of references to the text elements constituting this key or value.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ElementReference"
          }
        }
      }
    },
    "KeyValuePair": {
      "description": "Information about the extracted key-value pair.",
      "type": "object",
      "required": [
        "key",
        "value",
        "confidence"
      ],
      "properties": {
        "label": {
          "description": "A user defined label for the key/value pair entry.",
          "type": "string"
        },
        "key": {
          "description": "Information about the extracted key in a key-value pair.",
          "$ref": "#/$defs/KeyValueElement"
        },
        "value": {
          "description": "Information about the extracted value in a key-value pair.",
          "$ref": "#/$defs/KeyValueElement"
        },
        "confidence": {
          "description": "Confidence value.",
          "$ref": "#/$defs/Confidence"
        }
      }
    },
    "KeyValueType": {
      "type": "string",
      "description": "Semantic data type of the key value element.",
      "enum": [
        "string",
        "selectionMark"
      ],
      "x-ms-enum": {
        "name": "KeyValueType",
        "modelAsString": true
      }
    },
    "OperationStatus": {
      "type": "string",
      "description": "Status of the queued operation.",
      "enum": [
        "notStarted",
        "running",
        "succeeded",
        "failed"
      ],
      "x-ms-enum": {
        "name": "OperationStatus",
        "modelAsString": false
      }
    },
    "PageResult": {
      "description": "Extracted information from a single page.",
      "type": "object",
      "required": [
        "page"
      ],
      "properties": {
        "page": {
          "description": "Page number.",
          "type": "integer",
          "format": "int32",
          "minimum": 1
        },
        "clusterId": {
          "description": "Cluster identifier.",
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "keyValuePairs": {
          "description": "List of key-value pairs extracted from the page.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/KeyValuePair"
          }
        },
        "tables": {
          "description": "List of data tables extracted from the page.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/DataTable"
          }
        }
      }
    },
    "ReadResult": {
      "description": "Text extracted from a page in the input document.",
      "type": "object",
      "required": [
        "page",
        "angle",
        "width",
        "height",
        "unit"
      ],
      "properties": {
        "page": {
          "description": "The 1-based page number in the input document.",
          "type": "integer",
          "minimum": 1
        },
        "angle": {
          "description": "The general orientation of the text in clockwise direction, measured in degrees between (-180, 180].",
          "type": "number",
          "maximum": 180,
          "exclusiveMinimum": -180
        },
        "width": {
          "description": "The width of the image/PDF in pixels/inches, respectively.",
          "type": "number",
          "minimum": 0
        },
        "height": {
          "description": "The height of the image/PDF in pixels/inches, respectively.",
          "type": "number",
          "minimum": 0
        },
        "unit": {
          "description": "The unit used by the width, height and boundingBox properties. For images, the unit is \"pixel\". For PDF, the unit is \"inch\".",
          "type": "string",
          "enum": [
            "pixel",
            "inch"
          ],
          "x-ms-enum": {
            "name": "LengthUnit",
            "modelAsString": false
          }
        },
        "lines": {
          "description": "When includeTextDetails is set to true, a list of recognized text lines. The maximum number of lines returned is 300 per page. The lines are sorted top to bottom, left to right, although in certain cases proximity is treated with higher priority. As the sorting order depends on the detected text, it may change across images and OCR version updates. Thus, business logic should be built upon the actual line location instead of order.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/TextLine"
          }
        },
        "selectionMarks": {
          "description": "List of selection marks extracted from the page.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/SelectionMark"
          }
        }
      }
    },
    "SelectionMark": {
      "description": "Information about the extracted selection mark.",
      "type": "object",
      "required": [
        "boundingBox",
        "confidence",
        "state"
      ],
      "properties": {
        "boundingBox": {
          "description": "Bounding box of the selection mark.",
          "$ref": "#/$defs/BoundingBox"
        },
        "confidence": {
          "description": "Confidence value.",
          "$ref": "#/$defs/Confidence"
        },
        "state": {
          "description": "State of the selection mark.",
          "type": "string",
          "enum": [
            "selected",
            "unselected"
          ]
        }
      }
    },
    "Style": {
      "description": "An object representing the style of the text line.",
      "type": "object",
      "required": [
        "name",
        "confidence"
      ],
      "properties": {
        "name": {
          "description": "The text line style name, including handwriting and other.",
          "type": "string",
          "x-ms-enum": {
            "name": "TextStyle",
            "modelAsString": true
          },
          "enum": [
            "other",
            "handwriting"
          ]
        },
        "confidence": {
          "description": "The confidence of text line style.",
          "type": "number",
          "format": "float"
        }
      }
    },
    "TextLine": {
      "description": "An object representing an extracted text line.",
      "type": "object",
      "required": [
        "text",
        "boundingBox",
        "words"
      ],
      "properties": {
        "text": {
          "description": "The text content of the line.",
          "type": "string"
        },
        "boundingBox": {
          "description": "Bounding box of an extracted line.",
          "$ref": "#/$defs/BoundingBox"
        },
        "words": {
          "description": "List of words in the text line.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/TextWord"
          }
        },
        "appearance": {
          "description": "Text appearance properties.",
          "$ref": "#/$defs/Appearance"
        }
      }
    },
    "TextWord": {
      "description": "An object representing a word.",
      "type": "object",
      "required": [
        "boundingBox",
        "text"
      ],
      "properties": {
        "text": {
          "description": "The text content of the word.",
          "type": "string"
        },
        "boundingBox": {
          "description": "Bounding box of an extracted word.",
          "$ref": "#/$defs/BoundingBox"
        },
        "confidence": {
          "description": "Confidence value.",
          "$ref": "#/$defs/Confidence"
        }
      }
    }
  }
}