Skip to main content
POST
Upload a dataset version

Authorizations

Authorization
string
header
required

A Recursion API key, created in the console under API keys.

Headers

Idempotency-Key
string
required

Replay-protection key scoped to the verified tenant, organization, principal, this operation and the dataset: the same key from another caller, for another operation or for another dataset is a new request. It must contain 1 to 256 visible ASCII characters and be sent as exactly one header value. Request identity is the exact HTTP method, escaped path, raw query, and raw body bytes. The same request replays the original successful response; any different request returns 409 idempotency_conflict, and an active matching request returns 409 idempotency_in_progress. Completed receipts are retained for approximately 24 hours, pending claims may be reclaimed after approximately 1 hour, and no deduplication is guaranteed after expiry.

Required string length: 1 - 256
Pattern: ^[!-~]+$
x-tenant-id
string

Optional tenant consistency check. When present, it must name the tenant bound to the API key, including when x-organization-id is default.

Minimum string length: 1
x-organization-id
string

Organization in which to act. Required for a tenant-scoped API key. Optional for an organization-scoped key, where it must name that same organization. The value may be an organization id or default.

Minimum string length: 1

Path Parameters

datasetId
string<uuid>
required

Dataset id.

Body

application/json
baseVersion
integer<int64>
required
write-only

The latest ready version the file was edited from; 0 for a dataset with none. Any other value is refused with 409 conflict.

Required range: 0 <= x <= 9007199254740991
fileId
string<uuid>
required
write-only

A JSONL file uploaded with the files API: one row per line, each line a row object. A row has messages (required; each with role system, user, assistant or tool, content, and for an assistant turn toolCalls and an optional model, for a tool turn toolCallId), tools (name and inputSchema), graders (each {key, kind}: kind code takes exactly one of checks, each check with a required key unique within the row, or run {argv, fileIds}; kind agent takes criteria [{key, text}]), fileIds (ids of the organization files an episode opens with; not resolved by the upload), split (train or held_out; a row without one keeps its stored split, and a new row goes to held_out when a hash of its rowId says so, about 1 row in 10, otherwise to train; only train rows count toward sftReady), agentId, agentVersionId and environmentId (all three or none), and the server-owned rowId, source and reward ({components}). Integers inside tool schemas and call arguments stay within +-9007199254740991, or are written exactly as JavaScript prints their double (such as 9007199254740992 or 1e+21); other integer-valued spellings beyond that range (1e16, 9007199254740993), and fractions that round to an integer or infinity, are refused; a check's min, max and minutes stay within +-9007199254740991. The file is the whole content of the new version: rows are matched to the base version by rowId (a row without one is identified by its content), a row that differs replaces its predecessor, and a row the file leaves out is removed. A file with no rows is refused, so remove every row with managedAgentsRemoveDatasetRows. At most 64 MiB, 50,000 rows, 10,000 regex checks and 1 MiB of regex patterns in the file; a row has at most 5 regex checks and the file at most 16 distinct regex patterns, each a pattern of at most 128 characters that compiles to at most 1,000 instructions. The upload compiles each regex to validate it and does not run it.

Response

Created

counts
object
required
read-only

Row counts of the version; zero until it is ready.

datasetId
string<uuid>
required
read-only

Id of the dataset the version belongs to.

state
enum<string>
required
read-only

building while its rows are written, or after its builder crashed until a later upload or removal takes it over, once it has been silent for 30 minutes; ready once readable; failed when the build did not finish.

Available options:
building,
ready,
failed
version
integer<int64>
required
read-only

Version number, counted from 1 per dataset.

Required range: 1 <= x <= 9007199254740991