{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dpf-it-com/json-schema/dpf-it-com-get-status-by-spec-id-response-schema.json",
  "title": "Get Status Response (queried by specId)",
  "x-generated": "2026-11-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dpf-it-com-openapi.yml#/components/schemas/GetStatusBySpecIdResponse",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "data": {
      "type": "object",
      "description": "The data_specs record's own process status — schema inference and code generation,\nrun by start-analysis. Independent of any data_jobs record.\n",
      "properties": {
        "specId": {
          "type": "string",
          "format": "uuid"
        },
        "workspaceId": {
          "type": "string",
          "format": "uuid",
          "description": "Workspace ID"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "processing",
            "ready",
            "failed"
          ],
          "description": "\"pending\": analysis never run. \"processing\": start-analysis is running.\n\"ready\": schema inference + code generation succeeded (transformationConfig is\npopulated). \"failed\": the analysis pipeline itself failed — see error/errorDetails.\n"
        },
        "statusMessage": {
          "type": "string",
          "description": "Human-readable status message"
        },
        "progress": {
          "type": "integer",
          "description": "Progress percentage (0-100)",
          "minimum": 0,
          "maximum": 100
        },
        "error": {
          "type": [
            "string",
            "null"
          ],
          "description": "Error code (only present if status=failed). Possible values:\n- `FILE_TOO_LARGE`: Sample, format, or target schema file exceeds 100 KB\n- `SCHEMA_INFERENCE_FAILED`: AI could not determine target schema\n- `PARSE_CODE_GENERATION_FAILED`: AI failed to generate parsing code\n- `TRANSFORM_CODE_GENERATION_FAILED`: AI failed to generate transform code\n- `INVALID_SCHEMA`: Derived schema was structurally invalid\n- `JOB_STAGING_ERROR`: Failed to copy sample file into the job folder\n- `INSUFFICIENT_CREDITS`: Workspace owner lacked credits to start the data load\n- `DATA_LOAD_INVOCATION_ERROR`: Failed to start the Glue data-load job\n- `LAMBDA_INVOCATION_ERROR`: Failed to invoke prepare-transformation\n- `PREPARATION_TIMEOUT`: The pipeline did not finish before the Lambda timed out\n- `PREPARATION_ERROR`: General preparation failure\n- `SPEC_FILES_MISSING`: A file the spec names was never uploaded (or uploaded empty), so\n  start-analysis refused to run. Set on specs that have never completed an analysis; re-upload\n  the file and start analysis again\n"
        },
        "errorDetails": {
          "type": [
            "string",
            "null"
          ],
          "description": "Human-readable error details (only present if status=failed)"
        },
        "lastJobId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "The data_jobs record from the most recent start-analysis run with loadSampleData\ntrue (or from create-job/start-job). Null if no such job exists yet — including\nwhile a start-analysis run is still in its AI phase, since the job record is only\ncreated once preparation succeeds and the data load actually starts. Once status\nis \"ready\", poll this separately via get-status(jobId) for data-load progress.\n"
        },
        "analysisStartTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the most recent analysis run started (null if never run)"
        },
        "analysisEndTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the most recent analysis run finished (null if still running or never run)"
        },
        "analysisDurationMs": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Duration of the most recent analysis run in milliseconds (null if still running or never run)"
        },
        "hasTransformationConfig": {
          "type": "boolean",
          "description": "Whether the spec has generated parse/transform code"
        }
      }
    }
  }
}