{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ffpipe-dev/json-schema/ffpipe-dev-job-status-schema.json",
  "title": "JobStatus",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ffpipe-dev-openapi.json#/components/schemas/JobStatus",
  "type": "object",
  "required": [
    "jobId",
    "status"
  ],
  "properties": {
    "jobId": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "enum": [
        "awaiting_upload",
        "queued",
        "processing",
        "finished",
        "error"
      ],
      "description": "`awaiting_upload` only for upload-mode jobs whose PUT has not completed. `processing` is reserved and not emitted today."
    },
    "uploadExpiresAt": {
      "type": "string",
      "format": "date-time",
      "description": "Only while `awaiting_upload`: the PUT deadline. The `uploadUrl` itself is deliberately NOT repeated here — it was handed out exactly once, in the 202."
    },
    "resultUrl": {
      "type": "string",
      "format": "uri",
      "description": "Download URL for the output — download within 24 hours of completion. Only on `finished`. Always this gateway's `GET /v1/jobs/{id}/result` (a frames job's: `GET /v1/jobs/{id}/frames/manifest`) — free, re-downloadable, Range-supporting, same `t` token, never a redirect: just GET it."
    },
    "thumbnailUrl": {
      "type": "string",
      "format": "uri",
      "description": "Poster frame download URL, when the pipeline produced one — same serving semantics as `resultUrl` (always `GET /v1/jobs/{id}/thumbnail` on this gateway)."
    },
    "durationMs": {
      "type": "integer",
      "description": "Output duration in milliseconds."
    },
    "frameCount": {
      "type": "integer",
      "description": "Frames jobs only: how many frames the manifest at `resultUrl` lists."
    },
    "errorMessage": {
      "type": "string",
      "description": "Human-readable failure reason. Only on `error`."
    },
    "retryVoucher": {
      "type": "string",
      "description": "Free-retry credential ({uuid}.{hmac}) for a job we charged for and failed to deliver. Send it as `x-retry-voucher` on the same kind of endpoint. Absent when the failure cost you nothing (settlement voided) or when the lineage already used its 3 retries."
    }
  }
}