{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sudomock-com/json-schema/sudomock-com-job-status-response-schema.json",
  "title": "JobStatusResponse",
  "description": "Where a job stands right now, and its result once it has finished.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sudomock-com-openapi.json#/components/schemas/JobStatusResponse",
  "properties": {
    "job_id": {
      "type": "string",
      "description": "Identifier of this job."
    },
    "kind": {
      "type": "string",
      "description": "What this job does: render, video, upload, 2d_create, 2d_render, photo_mockup_create or photo_mockup_render."
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "dispatched",
        "running",
        "succeeded",
        "failed",
        "cancelled"
      ],
      "description": "Where the job stands, and it is over once this reads succeeded, failed or cancelled."
    },
    "result_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Link to the finished file, or the path of the mockup that was created, and null until the job succeeds."
    },
    "mockup_uuid": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Identifier of the mockup this job created, and null for jobs that hand back a file instead."
    },
    "error": {
      "anyOf": [
        {
          "$ref": "#/$defs/JobError"
        },
        {
          "type": "null"
        }
      ],
      "description": "Why the job produced no result, and null unless it failed or was cancelled."
    },
    "credits_charged": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Credits you actually paid for this job, which is zero once a failed or cancelled job has been refunded."
    },
    "payg": {
      "anyOf": [
        {
          "$ref": "#/$defs/JobPaygCost"
        },
        {
          "type": "null"
        }
      ],
      "description": "Pay as you go cost of this job, and null when it was paid for with plan or extra credits."
    },
    "watermark": {
      "anyOf": [
        {
          "$ref": "#/$defs/JobWatermark"
        },
        {
          "type": "null"
        }
      ],
      "description": "Why this result is marked and how to get unmarked results, and null when the result is clean."
    },
    "created_at": {
      "type": "string",
      "description": "When this job was submitted."
    },
    "updated_at": {
      "type": "string",
      "description": "When this job last changed."
    },
    "model": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The video model that produced this clip, present on video jobs only."
    },
    "outcome_tier": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The quality level this clip was produced at, present on video jobs only."
    }
  },
  "type": "object",
  "required": [
    "job_id",
    "kind",
    "status",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "JobError": {
      "properties": {
        "error_code": {
          "type": "string",
          "description": "Stable code for this failure, safe to branch on in your own code."
        },
        "message": {
          "type": "string",
          "description": "Plain language explanation of what went wrong."
        }
      },
      "type": "object",
      "required": [
        "error_code",
        "message"
      ],
      "title": "JobError",
      "description": "Why a job produced no result."
    },
    "JobPaygCost": {
      "properties": {
        "credits": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Credits this job bills."
        },
        "unit_price": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "Price of one credit in US dollars for this account."
        },
        "cost": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "Total US dollars for this job, the credits multiplied by the unit price."
        }
      },
      "type": "object",
      "title": "JobPaygCost",
      "description": "What this job costs at the account's pay as you go rate."
    },
    "JobWatermark": {
      "properties": {
        "reason": {
          "type": "string",
          "description": "Why this result was marked."
        },
        "remove_url": {
          "type": "string",
          "description": "Where to go to start getting unmarked results."
        }
      },
      "type": "object",
      "required": [
        "reason",
        "remove_url"
      ],
      "title": "JobWatermark",
      "description": "Why the result carries a watermark, and where to get results without one."
    }
  }
}