{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/riveterhq-com/json-schema/riveterhq-com-dataset-schema.json",
  "title": "Dataset",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/riveterhq-com-openapi.json#/components/schemas/Dataset",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "ds_..."
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "input_columns": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Input column names, in order (row identity)"
    },
    "index_column": {
      "type": [
        "string",
        "null"
      ],
      "description": "The input column rows are unique on"
    },
    "enrichment_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The bound enrichment (its output columns are the dataset's)"
    },
    "output_columns": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Output column names, in order (from the bound enrichment; [] without one). Prompts and schemas are on GET /enrichments/{enrichment_id}"
    },
    "row_count": {
      "type": "integer"
    },
    "rows_expired": {
      "type": "boolean",
      "description": "True once the rows were removed by retention; the structure stays"
    },
    "import_in_progress": {
      "type": "boolean",
      "description": "A CSV import accepted with 202 has not landed yet"
    },
    "runs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DatasetRunSummary"
      },
      "description": "The five newest runs on the dataset"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "DatasetRunSummary": {
      "type": "object",
      "description": "A run on a dataset, as the dataset lists it (the full run is GET /runs/{id})",
      "properties": {
        "id": {
          "type": "string",
          "description": "run_..."
        },
        "type": {
          "type": "string",
          "enum": [
            "dataset_build",
            "enrichment"
          ],
          "description": "dataset_build = list generation; enrichment = a fill"
        },
        "status": {
          "type": "string"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "finished_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  }
}