> ## 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.appendItems()

> Add rows to a dataset.

Send up to 10,000 row objects in a body no larger than 2 MiB. Use `fields` to map row keys to dataset fields; omitted or empty `fields` stores each complete row in "uploaded". Returns the number created. Use a file upload for larger requests.

## Signature

Method signature on `client.datasets`:

```ts theme={null}
appendItems(args: {
  datasetId: string;
  fields?: { name: string; jsonSchema?: undefined | JsonSchema }[];
  items: { [key: string]: JsonValue }[];
}): Promise<{ created: number }>;
```

## Parameters

**datasetId** `string` *required*

Dataset ID with prefix `ds.`.

**fields** `\{ name: string; jsonSchema?: undefined | JsonSchema \}[]`

Fields to write by matching row keys. Missing fields are created. Omit or send an empty array to store each complete row in "uploaded".

**Fields**

**name** `string` *required*

Name of a dataset field to match to a key in each row.

**jsonSchema** `JsonSchema`

JSON Schema for the field values. Defaults to \{} (accepts any value).

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

**items** `\{ [key: string]: JsonValue \}[]` *required*

Rows to add. Each row is a JSON object keyed by field name.

**Fields**

**\[key: string]** `JsonValue`

See the [HTTP endpoint](https://docs.platform.toloka.ai/docs/api-reference/datasets/add-dataset-items.md) for the complete schema.

## Returns

`Promise<{ created: number }>`

**created** `number` *required*

Number of dataset items created by this request.

## Errors

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

| Status | Description |
| - | - |
| 400 | Payload too large, invalid field values, or item limit reached |
| 404 | Dataset not found |
| 429 | Rate limit exceeded |

HTTP endpoint: [`POST /datasets/{datasetId}/items`](https://docs.platform.toloka.ai/docs/api-reference/datasets/add-dataset-items).

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

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

const appendSummary = await client.datasets.appendItems({
  datasetId: "ds.019a0000-0000-7000-8000-000000000001",
  items: [
    {
      text: "Classify this sentence."
    }
  ]
});
console.log(appendSummary);
```

```json appendItems() theme={null}
{
  "created": 0
}
```


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