{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pixly-app/json-schema/pixly-app-job-schema.json",
  "title": "Job",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pixly-app-openapi.yml#/components/schemas/Job",
  "type": "object",
  "required": [
    "jobId",
    "type",
    "status",
    "creditsCharged",
    "createdAt"
  ],
  "properties": {
    "jobId": {
      "type": "string",
      "description": "Job id — pass to get_job to poll"
    },
    "type": {
      "type": "string",
      "enum": [
        "image_staging",
        "video_pair",
        "video_tour"
      ],
      "description": "Job family"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "processing",
        "completed",
        "failed"
      ],
      "description": "Anything not completed/failed is still running"
    },
    "creditsCharged": {
      "type": [
        "number",
        "null"
      ],
      "description": "Credits debited for this job"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Submission time"
    },
    "completedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Present once finished"
    },
    "resultUrls": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Presigned download URLs (present when completed; valid 7 days)"
    },
    "resultPaths": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Storage path of each result, in resultUrls order — pass one as r2Path (or beforeR2Path, a photos[] item…) to run another tool on this result"
    },
    "error": {
      "type": "string",
      "description": "Failure reason; the message says whether the credit came back immediately or is in 24h refund review"
    },
    "note": {
      "type": "string",
      "description": "Hint for agents, e.g. poll again in a few seconds"
    }
  }
}