{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/changethisfile-com/json-schema/changethisfile-com-job-status-schema.json",
  "title": "JobStatus",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/changethisfile-com-openapi.yml#/components/schemas/JobStatus",
  "type": "object",
  "required": [
    "job_id",
    "status"
  ],
  "properties": {
    "job_id": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "processing",
        "completed",
        "failed"
      ],
      "description": "* `queued` — accepted but not yet picked up by a worker\n* `processing` — currently being converted\n* `completed` — conversion finished; `result` contains the download URL\n* `failed` — conversion failed; `error` describes the cause\n"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "result": {
      "type": "object",
      "description": "Present when `status` is `completed`.",
      "properties": {
        "file_url": {
          "type": "string",
          "format": "uri",
          "description": "Signed download URL valid for 24 hours."
        },
        "size": {
          "type": "integer",
          "description": "Size of the converted file in bytes."
        },
        "duration_ms": {
          "type": "integer"
        },
        "source_format": {
          "type": "string"
        },
        "target_format": {
          "type": "string"
        }
      }
    },
    "error": {
      "$ref": "#/$defs/Error"
    }
  },
  "$defs": {
    "Error": {
      "type": "object",
      "required": [
        "error"
      ],
      "properties": {
        "error": {
          "type": "object",
          "required": [
            "code",
            "message"
          ],
          "properties": {
            "code": {
              "type": "string",
              "description": "Machine-readable error code.",
              "enum": [
                "bad_request",
                "invalid_api_key",
                "quota_exceeded",
                "rate_limited",
                "file_too_large",
                "unsupported_route",
                "conversion_failed",
                "service_unavailable",
                "not_found",
                "invalid_signature"
              ]
            },
            "message": {
              "type": "string",
              "description": "Human-readable error message."
            },
            "details": {
              "type": "object",
              "description": "Optional structured details (e.g. limit, used, retry_after)."
            }
          }
        }
      }
    }
  }
}