{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bellatorsi-com/json-schema/bellatorsi-com-job-status-response-schema.json",
  "title": "JobStatusResponse",
  "description": "Response model for job status polling.",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bellatorsi-com-openapi.json#/components/schemas/JobStatusResponse",
  "properties": {
    "job_id": {
      "type": "string",
      "title": "Job Id",
      "description": "Job identifier"
    },
    "status": {
      "$ref": "#/$defs/JobStatus",
      "description": "Current job status"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At",
      "description": "Job creation timestamp"
    },
    "started_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Started At",
      "description": "Job start timestamp"
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Completed At",
      "description": "Job completion timestamp"
    },
    "task_count": {
      "type": "integer",
      "title": "Task Count",
      "description": "Number of tasks in schedule"
    },
    "result": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Result",
      "description": "Job result when completed"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error",
      "description": "Error message if failed"
    },
    "progress_percent": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 100.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Progress Percent",
      "description": "Job progress percentage (if available)"
    },
    "endpoint_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Endpoint Name",
      "description": "Endpoint that submitted this job"
    },
    "checks_completed": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Checks Completed",
      "description": "Number of checks/steps completed (for forensics endpoints)"
    },
    "total_checks": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Total Checks",
      "description": "Total number of checks/steps (for forensics endpoints)"
    }
  },
  "type": "object",
  "required": [
    "job_id",
    "status",
    "created_at",
    "task_count"
  ],
  "$defs": {
    "JobStatus": {
      "type": "string",
      "enum": [
        "queued",
        "processing",
        "completed",
        "failed",
        "cancelled"
      ],
      "title": "JobStatus",
      "description": "Status of an async job.\n\nJob lifecycle:\n1. QUEUED - Job submitted to queue, waiting for worker\n2. PROCESSING - Worker picked up job and is executing\n3. COMPLETED - Job finished successfully\n4. FAILED - Job encountered an error\n5. CANCELLED - Job was cancelled by user before completion"
    }
  }
}