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

> Get a dataset slice.

Poll a slice while it is being created; read its row count once it is ready.

## Signature

Method signature on `client.datasets`:

```ts theme={null}
getSlice(args: {
  sliceId: string;
}): Promise<DatasetSlice>;
```

## Parameters

**sliceId** `string` *required*

ID of the dataset slice, with prefix `dsl.`.

## Returns

`Promise<DatasetSlice>`

**id** `string` *required*

Slice id. The same id always selects the same rows with the same frozen values.

**datasetId** `string` *required*

ID of the dataset containing this slice, with prefix `ds.`.

**name** `string` *required*

The name that tells this slice apart.

**itemFilter** `object | null` *required*

The filter the rows matched when the slice was taken; null for every row.

**Fields**

**fieldValues** `DatasetFieldValueConditions`

Field-value conditions that selected rows must satisfy; defaults to no conditions.

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

**fieldSources** `DatasetFieldSourceConditions`

Field-author conditions that selected rows must satisfy; defaults to no conditions.

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

**missingRevisionFields** `string[]`

Field IDs with prefix `df.` that must have no revision on a selected row; defaults to an empty array.

**frozenFieldIds** `string[]` *required*

Fields the slice reads as they were at its cutoff. Other fields read live.

**fromSliceId** `string | null` *required*

The slice this one was taken from, if any.

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

Only a ready slice can select rows.

**rows** `number` *required*

Rows in the slice once it is ready; 0 until then.

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

Why the slice failed.

**Fields**

**code** `"no_rows" | "cutoff_not_settled"` *required*

Machine-readable reason the slice could not be created.

**message** `string` *required*

Explanation of the slice creation failure.

**cutoff** `string` *required*

The moment the slice was taken: its rows and its frozen fields are read as they were just before it.

**createdAt** `string` *required*

When the slice was requested.

## Errors

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

| Status | Description |
| - | - |
| 404 | Slice not found |
| 429 | Rate limit exceeded |

HTTP endpoint: [`GET /slices/{sliceId}`](https://docs.platform.toloka.ai/docs/api-reference/datasets/get-dataset-slice).

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

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

const slice = await client.datasets.getSlice({
  sliceId: "dsl.019a0000-0000-7000-8000-000000000001"
});
console.log(slice);
```

```json getSlice() theme={null}
{
  "id": "dsl.019a0000-0000-7000-8000-000000000001",
  "datasetId": "ds.019a0000-0000-7000-8000-000000000001",
  "name": "<string>",
  "itemFilter": null,
  "frozenFieldIds": [
    "df.019a0000-0000-7000-8000-000000000001"
  ],
  "fromSliceId": null,
  "status": "creating",
  "rows": 0,
  "error": null,
  "cutoff": "2026-01-01T00:00:00Z",
  "createdAt": "2026-01-01T00:00:00Z"
}
```


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