> ## Documentation Index
> Fetch the complete documentation index at: https://docs.platform.toloka.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# client.datasets.createFieldsFromUploadedRows()

> Create fields from uploaded rows.

Send top-level names from the inferred fields list. Creates dataset fields with inferred JSON Schemas and copies their values from uploaded rows. Future file uploads populate them too. Splits and slices that read these fields are blocked until copying finishes.

## Signature

Method signature on `client.datasets`:

```ts theme={null}
createFieldsFromUploadedRows(args: {
  datasetId: string;
  names: string[];
}): Promise<DatasetField[]>;
```

## Parameters

**datasetId** `string` *required*

Dataset ID with prefix `ds.`.

**names** `string[]` *required*

Top-level fields of the uploaded rows to add as dataset fields, as the inferred fields name them. Each becomes a dataset field with the JSON schema inferred from the uploaded rows.

## Returns

`Promise<DatasetField[]>`

Dataset fields created by this request.

Returns an array. Each item has these fields:

**id** `DatasetFieldId` *required*

Dataset field ID with prefix `df.`.

**name** `string` *required*

Name of the dataset field.

**description** `string | null` *required*

Description of the field, or null when none is set.

**jsonSchema** `JsonSchema` *required*

JSON Schema that values in this field must satisfy.

See the [HTTP endpoint](https://docs.platform.toloka.ai/docs/api-reference/datasets/create-dataset-fields-from-uploaded-rows.md) for the supported JSON Schema fields.

**internal** `boolean` *required*

True when this field is excluded from pipeline input bindings. The field is still included in dataset field responses.

**split** `object | null` *required*

Set when this is a split field: each row's value names its part.

**Fields**

**parts** `object[]` *required*

The parts, with their roles: trainings learn on train parts and validate on validate parts. Test parts are held out for evaluations: no training learns on them, and only a training on this field validates on a part that has both the validate and test roles.

See the [HTTP endpoint](https://docs.platform.toloka.ai/docs/api-reference/datasets/create-dataset-fields-from-uploaded-rows.md) for the complete schema.

**recipe** `object | null` *required*

How the next fill samples parts; null for an adopted field until a fill gives it shares.

**Fields**

**shares** `object[]` *required*

Target proportion of rows for each split part.

See the [HTTP endpoint](https://docs.platform.toloka.ai/docs/api-reference/datasets/create-dataset-fields-from-uploaded-rows.md) for the complete schema.

**balanceByFieldId** `string | null` *required*

Field ID with prefix `df.` used to balance labels, or null when balancing is disabled.

**seed** `number` *required*

Seed used to make the part assignments repeatable.

**status** `"filling" | "ready" | "failed"` *required*

A slice cannot be taken while the field is filling.

**progress** `object | null` *required*

Rows placed so far while the field is filling.

**Fields**

**placed** `number` *required*

Number of previously unassigned rows placed so far.

**total** `number` *required*

Number of rows to place in this fill.

**lastFill** `object | null` *required*

The last fill: rows it placed, rows that already had a part, and the rows each part held after it.

**Fields**

**placed** `number` *required*

Number of previously unassigned rows placed by the last fill.

**kept** `number` *required*

Number of rows whose existing part assignments were kept.

**parts** `object` *required*

Row counts for each part after the last fill, keyed by part name.

**error** `object | null` *required*

Why the last fill failed.

**Fields**

**code** `"too_many_labels" | "slice_failed"` *required*

Machine-readable reason the split fill failed.

**message** `string` *required*

Explanation of the split fill failure.

**operations** `DatasetFieldOperation[]` *required*

Operations currently writing to this field. A split or slice that reads the field is rejected while a blocking operation runs.

**type: "copy"**

**type** `"copy"` *required*

Operation kind: `copy` copies field values, `split_fill` assigns split parts, and `write` writes new field revisions.

**sourceFieldId** `DatasetFieldId` *required*

The field the values are copied from.

**blocking** `boolean` *required*

True when splits and slices that read this field must wait for the operation to finish.

**type: "split\_fill"**

**type** `"split_fill"` *required*

Operation kind: `copy` copies field values, `split_fill` assigns split parts, and `write` writes new field revisions.

**blocking** `boolean` *required*

True when splits and slices that read this field must wait for the operation to finish.

**type: "write"**

**type** `"write"` *required*

Operation kind: `copy` copies field values, `split_fill` assigns split parts, and `write` writes new field revisions.

**writer** `string` *required*

The source of the new field revisions. For a batch inference run, this is `batch-inference-run:<id>`.

**progress** `object | null` *required*

The number of rows written and the total number expected, when known.

See the [HTTP endpoint](https://docs.platform.toloka.ai/docs/api-reference/datasets/create-dataset-fields-from-uploaded-rows.md) for the complete schema.

**blocking** `boolean` *required*

True when splits and slices that read this field must wait for the operation to finish.

**createdAt** `string` *required*

Time the field was created, as an ISO 8601 timestamp.

## Errors

HTTP errors throw [`PotatoApiError`](https://docs.platform.toloka.ai/docs/sdk/errors). The endpoint documents these error responses:

| Status | Description |
| - | - |
| 400 | No uploaded rows yet, a field the uploaded rows do not have, or a dataset field that already exists |
| 404 | Dataset not found |
| 429 | Rate limit exceeded |

HTTP endpoint: [`POST /datasets/{datasetId}/fields/from-uploaded`](https://docs.platform.toloka.ai/docs/api-reference/datasets/create-dataset-fields-from-uploaded-rows).

```ts createFieldsFromUploadedRows() theme={null}
import { createClient } from "@toloka-platform/sdk";

const client = createClient({
  baseUrl: "https://platform.toloka.ai",
  apiKey: process.env.TOLOKA_API_KEY!,
});

const fields = await client.datasets.createFieldsFromUploadedRows({
  datasetId: "ds.019a0000-0000-7000-8000-000000000001",
  names: [
    "text"
  ]
});
console.log(fields);
```

```json createFieldsFromUploadedRows() theme={null}
[
  {
    "id": "df.019a0000-0000-7000-8000-000000000001",
    "name": "<string>",
    "description": null,
    "jsonSchema": {},
    "internal": false,
    "split": null,
    "operations": [
      {
        "type": "copy",
        "sourceFieldId": "df.019a0000-0000-7000-8000-000000000001",
        "blocking": false
      }
    ],
    "createdAt": "2026-01-01T00:00:00Z"
  }
]
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.