{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/smarterdata/json-schema/smarterdata-job-schema.json",
  "title": "Job",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/smarterdata-openapi.json#/components/schemas/Job",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "id": {
      "type": "string"
    },
    "kind": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "description": "the same as kind"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "complete",
        "failed",
        "cancelled"
      ]
    },
    "done": {
      "type": "integer"
    },
    "total": {
      "type": "integer"
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "started_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "finished_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "credits_held": {
      "type": "integer",
      "description": "While the job is queued or running."
    },
    "credits_used": {
      "type": "integer"
    },
    "credits_remaining": {
      "type": "integer"
    },
    "error": {
      "description": "On a failed or cancelled job."
    },
    "records": {
      "type": "array",
      "items": {}
    }
  }
}