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

> List inferred dataset fields.

Returns nested field names, paths, and JSON Schemas inferred from the first file upload that passes validation. Later uploads are checked against that schema and do not refresh it. The `fields` array is empty until this inference completes.

## Signature

Method signature on `client.datasets`:

```ts theme={null}
getInferredFields(args: {
  datasetId: string;
}): Promise<{ fields: InferredField[] }>;
```

## Parameters

**datasetId** `string` *required*

Dataset ID with prefix `ds.`.

## Returns

`Promise<{ fields: InferredField[] }>`

**fields** `InferredField[]` *required*

Nested fields inferred from the first validated dataset upload.

**Fields**

**name** `string` *required*

The field name at this path.

**jsonPath** `string` *required*

The JSONPath locating this field in a dataset item.

**depth** `number` *required*

The nesting depth of this field.

**jsonSchema** `JsonSchema` *required*

The JSON Schema inferred for values at this path.

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

## Errors

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

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

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

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

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

const inferredFields = await client.datasets.getInferredFields({
  datasetId: "ds.019a0000-0000-7000-8000-000000000001"
});
console.log(inferredFields);
```

```json getInferredFields() theme={null}
{
  "fields": [
    {
      "name": "<string>",
      "jsonPath": "<string>",
      "depth": 0,
      "jsonSchema": {}
    }
  ]
}
```


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