{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pictify-io/json-schema/pictify-io-batch-status-schema.json",
  "title": "BatchStatus",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pictify-io-batch-api-openapi.yml#/components/schemas/BatchStatus",
  "type": "object",
  "properties": {
    "batchId": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "processing",
        "completed",
        "failed",
        "partial",
        "cancelled"
      ]
    },
    "progress": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
    },
    "totalItems": {
      "type": "integer"
    },
    "completedItems": {
      "type": "integer"
    },
    "failedItems": {
      "type": "integer"
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "description": "Zero-based index of this item in the batch"
          },
          "success": {
            "type": "boolean",
            "description": "Whether this batch item rendered successfully"
          },
          "variables": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Variable names used for this item"
          },
          "results": {
            "type": "array",
            "description": "Rendered images, one per requested layout",
            "items": {
              "type": "object",
              "properties": {
                "layout": {
                  "type": "string",
                  "description": "Layout key ('default' for base layout)"
                },
                "name": {
                  "type": "string",
                  "description": "Display name of the layout"
                },
                "url": {
                  "type": "string",
                  "format": "uri",
                  "description": "URL of the rendered image"
                },
                "width": {
                  "type": "integer",
                  "description": "Image width in pixels"
                },
                "height": {
                  "type": "integer",
                  "description": "Image height in pixels"
                },
                "format": {
                  "type": "string",
                  "description": "Image format"
                },
                "id": {
                  "type": "string",
                  "description": "Unique render identifier"
                }
              }
            }
          },
          "errors": {
            "type": "array",
            "description": "Layout keys that failed to render for this item",
            "items": {
              "type": "object",
              "properties": {
                "layout": {
                  "type": "string"
                },
                "error": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "startedAt": {
      "type": "string",
      "format": "date-time"
    },
    "completedAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}