{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-ai-foundry/json-schema/azure-ai-foundry-analyze-batch-operation-schema.json",
  "title": "AnalyzeBatchOperation",
  "description": "Status and result of the analyze batch operation.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/azure-ai-foundry-document-models-api-openapi.yml#/components/schemas/AnalyzeBatchOperation",
  "type": "object",
  "properties": {
    "resultId": {
      "$ref": "#/$defs/Azure.Core.uuid",
      "description": "Analyze batch operation result ID."
    },
    "status": {
      "$ref": "#/$defs/DocumentIntelligenceOperationStatus",
      "description": "Operation status.  notStarted, running, succeeded, or failed"
    },
    "createdDateTime": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time (UTC) when the operation was submitted."
    },
    "lastUpdatedDateTime": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time (UTC) when the status was last updated."
    },
    "percentCompleted": {
      "type": "integer",
      "format": "int32",
      "description": "Operation progress (0-100).",
      "minimum": 0,
      "maximum": 100
    },
    "error": {
      "$ref": "#/$defs/DocumentIntelligenceError",
      "description": "Encountered error during batch document analysis."
    },
    "result": {
      "$ref": "#/$defs/AnalyzeBatchResult",
      "description": "Batch document analysis result."
    }
  },
  "required": [
    "status",
    "createdDateTime",
    "lastUpdatedDateTime"
  ],
  "$defs": {
    "AnalyzeBatchOperationDetail": {
      "type": "object",
      "description": "Operation detail for a document in a batch analysis.",
      "properties": {
        "status": {
          "$ref": "#/$defs/DocumentIntelligenceOperationStatus",
          "description": "Analyze status.  succeeded, failed, or skipped"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri",
          "description": "URL of the source document."
        },
        "resultUrl": {
          "type": "string",
          "format": "uri",
          "description": "URL of the analyze result JSON."
        },
        "error": {
          "$ref": "#/$defs/DocumentIntelligenceError",
          "description": "Encountered error."
        }
      },
      "required": [
        "status",
        "sourceUrl"
      ]
    },
    "AnalyzeBatchResult": {
      "type": "object",
      "description": "Batch document analysis result.",
      "properties": {
        "succeededCount": {
          "type": "integer",
          "format": "int32",
          "description": "Number of documents that completed with status succeeded."
        },
        "failedCount": {
          "type": "integer",
          "format": "int32",
          "description": "Number of documents that completed with status failed."
        },
        "skippedCount": {
          "type": "integer",
          "format": "int32",
          "description": "Number of documents that completed with status skipped."
        },
        "details": {
          "type": "array",
          "description": "Operation detail for each document in the batch.",
          "items": {
            "$ref": "#/$defs/AnalyzeBatchOperationDetail"
          }
        }
      },
      "required": [
        "succeededCount",
        "failedCount",
        "skippedCount"
      ]
    },
    "Azure.Core.uuid": {
      "type": "string",
      "format": "uuid",
      "description": "Universally Unique Identifier"
    },
    "DocumentIntelligenceError": {
      "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/DocumentIntelligenceError"
          }
        },
        "innererror": {
          "$ref": "#/$defs/DocumentIntelligenceInnerError",
          "description": "An object containing more specific information than the current object about the error."
        }
      },
      "required": [
        "code",
        "message"
      ]
    },
    "DocumentIntelligenceInnerError": {
      "type": "object",
      "description": "An object containing more specific information about the error.",
      "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."
        },
        "innererror": {
          "$ref": "#/$defs/DocumentIntelligenceInnerError",
          "description": "Inner error."
        }
      }
    },
    "DocumentIntelligenceOperationStatus": {
      "type": "string",
      "description": "Operation status.",
      "enum": [
        "notStarted",
        "running",
        "failed",
        "succeeded",
        "canceled",
        "skipped"
      ],
      "x-ms-enum": {
        "name": "DocumentIntelligenceOperationStatus",
        "modelAsString": true,
        "values": [
          {
            "name": "notStarted",
            "value": "notStarted",
            "description": "The operation has not started yet."
          },
          {
            "name": "running",
            "value": "running",
            "description": "The operation is in progress."
          },
          {
            "name": "failed",
            "value": "failed",
            "description": "The operation has failed."
          },
          {
            "name": "succeeded",
            "value": "succeeded",
            "description": "The operation has succeeded."
          },
          {
            "name": "canceled",
            "value": "canceled",
            "description": "The operation has been canceled."
          },
          {
            "name": "skipped",
            "value": "skipped",
            "description": "The operation has been skipped."
          }
        ]
      }
    }
  }
}