{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-ai-foundry/json-schema/azure-ai-foundry-content-analyzer-analyze-operation-status-schema.json",
  "title": "ContentAnalyzerAnalyzeOperationStatus",
  "description": "Provides status details for analyze operations.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/azure-ai-foundry-analyzerresults-api-openapi.yml#/components/schemas/ContentAnalyzerAnalyzeOperationStatus",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the operation."
    },
    "status": {
      "$ref": "#/$defs/Azure.Core.Foundations.OperationState",
      "description": "The status of the operation"
    },
    "error": {
      "$ref": "#/$defs/Azure.Core.Foundations.Error",
      "description": "Error object that describes the error when status is \"Failed\"."
    },
    "result": {
      "$ref": "#/$defs/AnalysisResult",
      "description": "The result of the operation."
    },
    "usage": {
      "$ref": "#/$defs/UsageDetails",
      "description": "Usage details of the analyze operation."
    }
  },
  "required": [
    "id",
    "status"
  ],
  "$defs": {
    "AnalysisContent": {
      "type": "object",
      "description": "Media content base class.",
      "properties": {
        "kind": {
          "$ref": "#/$defs/AnalysisContentKind",
          "description": "Content kind."
        },
        "mimeType": {
          "type": "string",
          "description": "Detected MIME type of the content.  Ex. application/pdf, image/jpeg, etc."
        },
        "analyzerId": {
          "type": "string",
          "description": "The analyzer that generated this content.",
          "minLength": 1,
          "maxLength": 64,
          "pattern": "^[a-zA-Z0-9._-]{1,64}$"
        },
        "category": {
          "type": "string",
          "description": "Classified content category."
        },
        "path": {
          "type": "string",
          "description": "The path of the content in the input."
        },
        "markdown": {
          "type": "string",
          "description": "Markdown representation of the content."
        },
        "fields": {
          "type": "object",
          "description": "Extracted fields from the content.",
          "additionalProperties": {
            "$ref": "#/$defs/ContentField"
          }
        }
      },
      "required": [
        "kind",
        "mimeType"
      ]
    },
    "AnalysisContentKind": {
      "type": "string",
      "description": "Kind of media content.",
      "enum": [
        "document",
        "audioVisual"
      ],
      "x-ms-enum": {
        "name": "AnalysisContentKind",
        "modelAsString": true,
        "values": [
          {
            "name": "document",
            "value": "document",
            "description": "Document content, such as pdf, image, txt, etc."
          },
          {
            "name": "audioVisual",
            "value": "audioVisual",
            "description": "Audio visual content, such as mp3, mp4, etc."
          }
        ]
      }
    },
    "AnalysisResult": {
      "type": "object",
      "description": "Analyze operation result.",
      "properties": {
        "analyzerId": {
          "type": "string",
          "description": "The unique identifier of the analyzer.",
          "minLength": 1,
          "maxLength": 64,
          "pattern": "^[a-zA-Z0-9._-]{1,64}$"
        },
        "apiVersion": {
          "type": "string",
          "description": "The version of the API used to analyze the document."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "The date and time when the result was created."
        },
        "warnings": {
          "type": "array",
          "description": "Warnings encountered while analyzing the document.",
          "items": {
            "$ref": "#/$defs/Azure.Core.Foundations.Error"
          }
        },
        "stringEncoding": {
          "type": "string",
          "description": "  The string encoding format for content spans in the response.\n  Possible values are 'codePoint', 'utf16', and `utf8`.  Default is `codePoint`.\")",
          "default": "codePoint"
        },
        "contents": {
          "type": "array",
          "description": "The extracted content.",
          "items": {
            "$ref": "#/$defs/AnalysisContent"
          }
        }
      },
      "required": [
        "contents"
      ]
    },
    "Azure.Core.Foundations.Error": {
      "type": "object",
      "description": "The error object.",
      "properties": {
        "code": {
          "type": "string",
          "description": "One of a server-defined set of error codes."
        },
        "message": {
          "type": "string",
          "description": "A human-readable representation of the error."
        },
        "target": {
          "type": "string",
          "description": "The target of the error."
        },
        "details": {
          "type": "array",
          "description": "An array of details about specific errors that led to this reported error.",
          "items": {
            "$ref": "#/$defs/Azure.Core.Foundations.Error"
          }
        },
        "innererror": {
          "$ref": "#/$defs/Azure.Core.Foundations.InnerError",
          "description": "An object containing more specific information than the current object about the error."
        }
      },
      "required": [
        "code",
        "message"
      ]
    },
    "Azure.Core.Foundations.InnerError": {
      "type": "object",
      "description": "An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.",
      "properties": {
        "code": {
          "type": "string",
          "description": "One of a server-defined set of error codes."
        },
        "innererror": {
          "$ref": "#/$defs/Azure.Core.Foundations.InnerError",
          "description": "Inner error."
        }
      }
    },
    "Azure.Core.Foundations.OperationState": {
      "type": "string",
      "description": "Enum describing allowed operation states.",
      "enum": [
        "NotStarted",
        "Running",
        "Succeeded",
        "Failed",
        "Canceled"
      ],
      "x-ms-enum": {
        "name": "OperationState",
        "modelAsString": true,
        "values": [
          {
            "name": "NotStarted",
            "value": "NotStarted",
            "description": "The operation has not started."
          },
          {
            "name": "Running",
            "value": "Running",
            "description": "The operation is in progress."
          },
          {
            "name": "Succeeded",
            "value": "Succeeded",
            "description": "The operation has completed successfully."
          },
          {
            "name": "Failed",
            "value": "Failed",
            "description": "The operation has failed."
          },
          {
            "name": "Canceled",
            "value": "Canceled",
            "description": "The operation has been canceled by the user."
          }
        ]
      }
    },
    "ContentField": {
      "type": "object",
      "description": "Field extracted from the content.",
      "properties": {
        "type": {
          "$ref": "#/$defs/ContentFieldType",
          "description": "Semantic data type of the field value."
        },
        "spans": {
          "type": "array",
          "description": "Span(s) associated with the field value in the markdown content.",
          "items": {
            "$ref": "#/$defs/ContentSpan"
          }
        },
        "confidence": {
          "type": "number",
          "format": "float",
          "description": "Confidence of predicting the field value.",
          "minimum": 0,
          "maximum": 1
        },
        "source": {
          "$ref": "#/$defs/SourceExpression",
          "description": "Encoded source that identifies the position of the field value in the content."
        }
      },
      "required": [
        "type"
      ]
    },
    "ContentFieldType": {
      "type": "string",
      "description": "Semantic data type of the field value.",
      "enum": [
        "string",
        "date",
        "time",
        "number",
        "integer",
        "boolean",
        "array",
        "object",
        "json"
      ],
      "x-ms-enum": {
        "name": "ContentFieldType",
        "modelAsString": true,
        "values": [
          {
            "name": "string",
            "value": "string",
            "description": "Plain text."
          },
          {
            "name": "date",
            "value": "date",
            "description": "Date, normalized to ISO 8601 (YYYY-MM-DD) format."
          },
          {
            "name": "time",
            "value": "time",
            "description": "Time, normalized to ISO 8601 (hh:mm:ss) format."
          },
          {
            "name": "number",
            "value": "number",
            "description": "Number as double precision floating point."
          },
          {
            "name": "integer",
            "value": "integer",
            "description": "Integer as 64-bit signed integer."
          },
          {
            "name": "boolean",
            "value": "boolean",
            "description": "Boolean value."
          },
          {
            "name": "array",
            "value": "array",
            "description": "List of subfields of the same type."
          },
          {
            "name": "object",
            "value": "object",
            "description": "Named list of subfields."
          },
          {
            "name": "json",
            "value": "json",
            "description": "JSON object."
          }
        ]
      }
    },
    "ContentSpan": {
      "type": "object",
      "description": "Position of the element in markdown, specified as a character offset and length.",
      "properties": {
        "offset": {
          "type": "integer",
          "format": "int32",
          "description": "Starting position (0-indexed) of the element in markdown, specified in characters."
        },
        "length": {
          "type": "integer",
          "format": "int32",
          "description": "Length of the element in markdown, specified in characters."
        }
      },
      "required": [
        "offset",
        "length"
      ]
    },
    "SourceExpression": {
      "type": "string",
      "description": "Encoded string expression that describes positions in the content."
    },
    "UsageDetails": {
      "type": "object",
      "description": "Usage details.",
      "properties": {
        "documentPagesMinimal": {
          "type": "integer",
          "format": "int32",
          "description": "The number of document pages processed at the minimal level.\nFor documents without explicit pages (ex. txt, html), every 3000 UTF-16 characters is counted as one page."
        },
        "documentPagesBasic": {
          "type": "integer",
          "format": "int32",
          "description": "The number of document pages processed at the basic level.\nFor documents without explicit pages (ex. txt, html), every 3000 UTF-16 characters is counted as one page."
        },
        "documentPagesStandard": {
          "type": "integer",
          "format": "int32",
          "description": "The number of document pages processed at the standard level.\nFor documents without explicit pages (ex. txt, html), every 3000 UTF-16 characters is counted as one page."
        },
        "audioHours": {
          "type": "number",
          "format": "float",
          "description": "The hours of audio processed."
        },
        "videoHours": {
          "type": "number",
          "format": "float",
          "description": "The hours of video processed."
        },
        "contextualizationTokens": {
          "type": "integer",
          "format": "int32",
          "description": "The number of contextualization tokens consumed for preparing context, generating confidence scores, source grounding, and output formatting."
        },
        "tokens": {
          "type": "object",
          "description": "The number of LLM and embedding tokens consumed, grouped by model (ex. GTP 4.1) and type (ex. input, cached input, output).",
          "additionalProperties": {
            "format": "int32",
            "type": "integer"
          }
        }
      }
    }
  }
}