{
  "openapi": "3.0.4",
  "info": {
    "title": "OcrAsAService.Api",
    "version": "1.0"
  },
  "paths": {
    "/api/health": {
      "get": {
        "tags": [
          "OcrAsAService.Api"
        ],
        "summary": "Health endpoint for infrastructure smoke tests",
        "operationId": "Health",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/ready": {
      "get": {
        "tags": [
          "OcrAsAService.Api"
        ],
        "summary": "Reports connected OCR agents and optionally requires a specific engine",
        "operationId": "Readiness",
        "parameters": [
          {
            "name": "engine",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/ocr/jobs": {
      "post": {
        "tags": [
          "OcrAsAService.Api"
        ],
        "summary": "Submit a PDF, JPG, PNG, or HEIC/HEIF file for OCR processing. Optional 'engine' form field (Tesseract, PaddleOcr, PpuPaddleOcr, or OcrMyPdf, defaults to Tesseract) picks which engine handles it. Optional 'languages' form field (defaults to \"eng\") picks which language(s) to look for: for Tesseract and OcrMyPdf, '+'-joined codes (e.g. \"eng+deu\") combined in one pass; for PaddleOcr, exactly one code (e.g. \"deu\"), never combined; ignored for PpuPaddleOcr, which always uses one multilingual model. Optional 'ocrOptions' form field (OcrMyPdf only) is a comma-separated list of ocrmypdf flags to enable: deskew, rotate-pages, clean, clean-final, optimize=N (N 0-3), mode=force|skip|redo (defaults to force - always re-OCR everything; skip leaves pages that already have text alone; redo replaces existing OCR without rasterizing). OcrMyPdf also returns the resulting searchable PDF - see GET /api/ocr/jobs/{jobId}/pdf.",
        "operationId": "SubmitOcrJob",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/ocr/jobs/{jobId}": {
      "get": {
        "tags": [
          "OcrAsAService.Api"
        ],
        "summary": "Get the status or result of an OCR job",
        "operationId": "GetOcrJobStatus",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/ocr/jobs/{jobId}/pdf": {
      "get": {
        "tags": [
          "OcrAsAService.Api"
        ],
        "summary": "Downloads the searchable PDF an OcrMyPdf job produced. 404 if the job doesn't exist, isn't yours, or has no result PDF (wrong engine, not completed yet, or failed).",
        "operationId": "GetOcrJobResultPdf",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/agent-updates/latest-version": {
      "get": {
        "tags": [
          "OcrAsAService.Api"
        ],
        "summary": "Version of the agent build embedded in this backend deployment, for the agent host auto-updater",
        "operationId": "GetLatestAgentVersion",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/agent-updates/download": {
      "get": {
        "tags": [
          "OcrAsAService.Api"
        ],
        "summary": "Downloads the agent build embedded in this backend deployment, for the agent host auto-updater",
        "operationId": "DownloadLatestAgent",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": { },
  "tags": [
    {
      "name": "OcrAsAService.Api"
    }
  ]
}