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

# Datasets

> Create, list, get, update, and delete datasets.

A dataset is a named container for your documents. You must create a dataset before uploading files into it.

## Create a dataset

When creating a dataset, you must specify a **region** — this determines where your data is physically stored.
Once set, a dataset's region cannot be changed. See [available regions](/regions).

<Tabs>
  <Tab title="CLI" icon="terminal">
    ```bash theme={null}
    topk dataset create my-dataset --region aws-us-east-1-elastica

    # (Optional) Dataset description can be also specified:
    topk dataset create my-dataset --region aws-us-east-1-elastica --description "My dataset"
    ```
  </Tab>

  <Tab title="Python SDK" icon="https://mintcdn.com/topk/8NBkS0nek3e9o6Vi/icons/python.svg?fit=max&auto=format&n=8NBkS0nek3e9o6Vi&q=85&s=97cbee7891538170fd752e1afbc98095" width="128" height="128" data-path="icons/python.svg">
    <CodeGroup>
      ```python Sync theme={null}
      client.datasets().create("my-docs")

      # (Optional) Dataset description can be also specified:
      client.datasets().create("my-docs", description="My dataset")
      ```

      ```python Async theme={null}
      await client.datasets().create("my-docs")

      # (Optional) Dataset description can be also specified:
      await client.datasets().create("my-docs", description="My dataset")
      ```
    </CodeGroup>
  </Tab>

  <Tab title="JavaScript SDK" icon="https://mintcdn.com/topk/8NBkS0nek3e9o6Vi/icons/js.svg?fit=max&auto=format&n=8NBkS0nek3e9o6Vi&q=85&s=7642cf18b45f52a70f141214b3d0eca1" width="24" height="24" data-path="icons/js.svg">
    ```typescript theme={null}
    await client.datasets().create("my-docs");

    // (Optional) Dataset description can be also specified:
    await client.datasets().create("my-docs", "My dataset");
    ```
  </Tab>
</Tabs>

## List datasets

<Tabs>
  <Tab title="CLI" icon="terminal">
    ```bash theme={null}
    topk dataset list
    ```
  </Tab>

  <Tab title="Python SDK" icon="https://mintcdn.com/topk/8NBkS0nek3e9o6Vi/icons/python.svg?fit=max&auto=format&n=8NBkS0nek3e9o6Vi&q=85&s=97cbee7891538170fd752e1afbc98095" width="128" height="128" data-path="icons/python.svg">
    <CodeGroup>
      ```python Sync theme={null}
      datasets = client.datasets().list()

      for dataset in datasets:
          print(dataset.name)
      ```

      ```python Async theme={null}
      datasets = await client.datasets().list()

      for dataset in datasets:
          print(dataset.name)
      ```
    </CodeGroup>
  </Tab>

  <Tab title="JavaScript SDK" icon="https://mintcdn.com/topk/8NBkS0nek3e9o6Vi/icons/js.svg?fit=max&auto=format&n=8NBkS0nek3e9o6Vi&q=85&s=7642cf18b45f52a70f141214b3d0eca1" width="24" height="24" data-path="icons/js.svg">
    ```typescript theme={null}
    const datasets = await client.datasets().list();

    for (const dataset of datasets) {
      console.log(dataset.name);
    }
    ```
  </Tab>
</Tabs>

## Get a dataset

<Tabs>
  <Tab title="CLI" icon="terminal">
    ```bash theme={null}
    topk dataset get my-docs
    ```
  </Tab>

  <Tab title="Python SDK" icon="https://mintcdn.com/topk/8NBkS0nek3e9o6Vi/icons/python.svg?fit=max&auto=format&n=8NBkS0nek3e9o6Vi&q=85&s=97cbee7891538170fd752e1afbc98095" width="128" height="128" data-path="icons/python.svg">
    <CodeGroup>
      ```python Sync theme={null}
      dataset = client.datasets().get("my-docs")

      print(dataset.name)
      ```

      ```python Async theme={null}
      dataset = await client.datasets().get("my-docs")

      print(dataset.name)
      ```
    </CodeGroup>
  </Tab>

  <Tab title="JavaScript SDK" icon="https://mintcdn.com/topk/8NBkS0nek3e9o6Vi/icons/js.svg?fit=max&auto=format&n=8NBkS0nek3e9o6Vi&q=85&s=7642cf18b45f52a70f141214b3d0eca1" width="24" height="24" data-path="icons/js.svg">
    ```typescript theme={null}
    const dataset = await client.datasets().get("my-docs");

    console.log(dataset.name);
    ```
  </Tab>
</Tabs>

## Update a dataset

Update dataset **description**:

<Tabs>
  <Tab title="CLI" icon="terminal">
    ```bash theme={null}
    topk dataset update my-docs --description "Annual financial filings"
    ```
  </Tab>

  <Tab title="Python SDK" icon="https://mintcdn.com/topk/8NBkS0nek3e9o6Vi/icons/python.svg?fit=max&auto=format&n=8NBkS0nek3e9o6Vi&q=85&s=97cbee7891538170fd752e1afbc98095" width="128" height="128" data-path="icons/python.svg">
    <CodeGroup>
      ```python Sync theme={null}
      dataset = client.datasets().update(
          "my-docs",
          description="Annual financial filings",
      )

      print(dataset.description)
      ```

      ```python Async theme={null}
      dataset = await client.datasets().update(
          "my-docs",
          description="Annual financial filings",
      )

      print(dataset.description)
      ```
    </CodeGroup>
  </Tab>

  <Tab title="JavaScript SDK" icon="https://mintcdn.com/topk/8NBkS0nek3e9o6Vi/icons/js.svg?fit=max&auto=format&n=8NBkS0nek3e9o6Vi&q=85&s=7642cf18b45f52a70f141214b3d0eca1" width="24" height="24" data-path="icons/js.svg">
    ```typescript theme={null}
    const dataset = await client.datasets().update("my-docs", {
      description: "Annual financial filings",
    });

    console.log(dataset.description);
    ```
  </Tab>
</Tabs>

## Delete a dataset

<Warning>
  Deleting a dataset is irreversible.

  All documents stored in the dataset will be permanently removed.
</Warning>

<Tabs>
  <Tab title="CLI" icon="terminal">
    ```bash theme={null}
    topk dataset delete --dataset my-docs
    ```

    The CLI will prompt for confirmation. Use `-y` to skip:

    ```bash theme={null}
    topk dataset delete --dataset my-docs -y
    ```
  </Tab>

  <Tab title="Python SDK" icon="https://mintcdn.com/topk/8NBkS0nek3e9o6Vi/icons/python.svg?fit=max&auto=format&n=8NBkS0nek3e9o6Vi&q=85&s=97cbee7891538170fd752e1afbc98095" width="128" height="128" data-path="icons/python.svg">
    <CodeGroup>
      ```python Sync theme={null}
      client.datasets().delete("my-docs")
      ```

      ```python Async theme={null}
      await client.datasets().delete("my-docs")
      ```
    </CodeGroup>
  </Tab>

  <Tab title="JavaScript SDK" icon="https://mintcdn.com/topk/8NBkS0nek3e9o6Vi/icons/js.svg?fit=max&auto=format&n=8NBkS0nek3e9o6Vi&q=85&s=7642cf18b45f52a70f141214b3d0eca1" width="24" height="24" data-path="icons/js.svg">
    ```typescript theme={null}
    await client.datasets().delete("my-docs");
    ```
  </Tab>
</Tabs>
