{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/riveterhq-com/json-schema/riveterhq-com-enrichment-schema.json",
  "title": "Enrichment",
  "description": "An enrichment (the recipe a fill runs). A legacy enrichment's id answers its older shape (the legacy API docs) with `legacy` set.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/riveterhq-com-openapi.json#/components/schemas/Enrichment",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "enr_..."
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "prompt": {
      "type": "string",
      "description": "The task prompt the row agent reads for every row"
    },
    "input_columns": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The headers rows must carry (empty = any)"
    },
    "output": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OutputColumnSpec"
      }
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The tools the row agent may call (names from GET /tools)"
    },
    "budget_credits_per_row": {
      "type": "number",
      "description": "The most the row agent may spend on one row. Moves by 1.5 per output column added or removed unless `budget_locked`"
    },
    "budget_locked": {
      "type": "boolean",
      "description": "true when the budget stays as set through column changes"
    },
    "version": {
      "type": "integer",
      "description": "Goes up by one on every column change; a cell filled under an older version reads `stale`"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "legacy": {
      "$ref": "#/$defs/LegacyNotice"
    }
  },
  "$defs": {
    "ColumnToolPin": {
      "type": [
        "string",
        "null"
      ],
      "description": "A tool name from GET /tools. The row agent makes one call of it per row — arguments it works out from the row, the known values, and its research; the column `prompt` says what to call it on — and the call's result is the cell. `null` unpins. `help` with `pinned_columns`."
    },
    "LegacyNotice": {
      "type": "object",
      "description": "Present on a response when the request took a legacy mode — a legacy enrichment's id on `/enrich`,\n`/enrichments/{id}`, `/monitors`, or `GET /runs`; a monitor on a legacy enrichment; an `output` column\nwith legacy-pipeline fields on `/enrich`; the list-build body on `POST /datasets`. The response also\ncarries `Deprecation: true` and a `Link` header (`rel=\"successor-version\"`). The legacy generation is\ndocumented in [the legacy API docs](?spec=legacy).\n",
      "properties": {
        "notice": {
          "type": "string",
          "description": "One or two sentences — what was legacy about the request and what to send instead"
        },
        "successor": {
          "type": "string",
          "description": "`METHOD /v1/path` of the current operation to use"
        },
        "docs": {
          "type": "string",
          "format": "uri",
          "description": "The successor's section of this reference"
        }
      },
      "required": [
        "notice",
        "successor",
        "docs"
      ]
    },
    "OutputColumnSpec": {
      "type": "object",
      "description": "One output column of an enrichment. A plain string is accepted in its place (a column name with no prompt or schema).",
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 100,
          "description": "The column name; the handle in every later call"
        },
        "prompt": {
          "type": "string",
          "maxLength": 5000,
          "description": "What to find for this column, one value, on top of the enrichment's task prompt; on a pinned column, what to call the tool on. Leave sources out; the agent records the URLs it cited on the cell's `sources`."
        },
        "output_schema": {
          "type": "object",
          "description": "A JSON Schema for the cell value (`help` with `output_schema`). Leave it out: the type is inferred from the prompt, caveats included. Send one only for an enum, a list, or an object. Does not apply to a pinned column."
        },
        "tool": {
          "$ref": "#/$defs/ColumnToolPin"
        }
      },
      "required": [
        "name"
      ]
    }
  }
}