Skip to main content
POST
Add graded sessions to a dataset

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 rows are added to; 0 for a dataset with none. Any other value is refused with 409 conflict.

Required range: 0 <= x <= 9007199254740991
sessionIds
string<uuid>[]
required
write-only

Root sessions of the organization to add as rows. Each must have been graded: the newest evaluation you can read that recorded its criteria supplies the row's grader (its criteria) and reward (its verdicts).

Required array length: 1 - 1000 elements
split
enum<string>
write-only

Split of every added row. Omit to keep the split of the session's rows already in the dataset, and otherwise to assign the session's rows to held_out when a hash of the session id says so (about 1 in 10), else to train, so a session's segments share one split.

Available options:
train,
held_out

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