---
title: "Create a fixed or consume dataset from columns and rows; bad rows are reported by number."
method: POST
path: "/v1/datasets"
---

# Create a fixed or consume dataset from columns and rows; bad rows are reported by number.

`POST /v1/datasets`

## Request

- Base URL: `http://127.0.0.1:10108`
- URL: `http://127.0.0.1:10108/v1/datasets`
- Auth: HTTP bearer

Creates a new dataset with these columns and up to 5000 rows. A fixed dataset gives each profile its own row; a consume dataset hands out rows to runs until they are used. Rows that do not fit the columns are skipped and reported by number.

## Request body

- object
  - `columns` object[], required
    - `name` string, required
    - `secret` boolean
  - `mode` 'fixed' | 'consume', required
  - `name` string, required
  - `rows` object[]: One object per row, keyed by column name; every value must be a string — convert numbers and dates to text before sending
  - `rows_per_run` integer

## Response `200`

The new dataset, how many rows were imported, and the numbers of the rows refused.

- object
  - `datasetId` string, uuid, required
  - `imported` integer, required
  - `rejected` object[], required
    - `lineNo` integer, required
    - `reason` 'fieldCount' | 'unclosedQuote' | 'unknownColumn' | 'emptyRow', required

## Other responses

- `400`: Bad column names, a reserved column, rows_per_run on a fixed dataset, or more than 5000 rows.
- `401`: No bearer token, or not a token this app issued. The body is empty: it never says which.
- `403`: Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.
- `409`: A dataset with this name already exists.
- `500`: Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

---

[API](https://skmtc.dev/veilus/apis/veilus-local-api.md) · [All operations](https://skmtc.dev/veilus/apis/veilus-local-api/llms.txt) · [OpenAPI document](https://skmtc.dev/veilus/apis/veilus-local-api/revisions/67ac3818f9d2?raw)
