> For the complete documentation index, see [llms.txt](https://old-docs.clarifai.com/guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://old-docs.clarifai.com/guide/api-guide/data/datasets/dataset-basics.md).

# Dataset Basics

## Create a dataset

{% tabs %}
{% tab title="cURL" %}

```
curl --location --request POST 'api.clarifai.com/v2/datasets' \
--header 'Authorization: Key {{YOUR API KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "datasets": [
        {
            "id": "dataset-1633032323",
            "name": "foo",
            "description": "This is the foo dataset",
            "metadata": {
                "lol": "hey"
            }
        }
    ]
}'
```

{% endtab %}
{% endtabs %}

## List datasets

{% tabs %}
{% tab title="cURL" %}

```
curl --location --request GET 'api.clarifai.com/v2/datasets?page=1&per_page=100' \
--header 'Authorization: Key {{YOUR API KEY}}' \
--header 'Content-Type: application/json'
```

{% endtab %}
{% endtabs %}

## Get datasets

{% tabs %}
{% tab title="cURL" %}

```
curl --location -g --request GET 'api.clarifai.com/v2/datasets/{{dataset_id}}' \
--header 'Authorization: Key {{YOUR API KEY}}' \
--header 'Content-Type: application/json'
```

{% endtab %}
{% endtabs %}

## Update datasets

{% tabs %}
{% tab title="cURL" %}

```
curl --location --request PATCH 'api.clarifai.com/v2/datasets' \
--header 'Authorization: Key {{YOUR API KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "datasets": [
        {
            "id": "{{dataset_id}}",
            "name": "foo",
            "description": "This is the new foo dataset",
            "metadata": {
                "foo": "bar"
            }
        }
    ],
    "action": "overwrite"
}'
```

{% endtab %}
{% endtabs %}

## Update datasets with default filter

{% tabs %}
{% tab title="cURL" %}

```
curl --location --request PATCH 'api.clarifai.com/v2/datasets' \
--header 'Authorization: Key {{YOUR API KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "datasets": [
        {
            "id": "{{dataset_id}}",
            "name": "foo",
            "description": "This is the new foo dataset",
            "metadata": {
                "foo": "bar"
            },
            "default_filter_id": "{{dataset_filter_id}}"
        }
    ],
    "action": "overwrite"
}'
```

{% endtab %}
{% endtabs %}

## Delete datasets

{% tabs %}
{% tab title="cURL" %}

```
curl --location --request DELETE 'api.clarifai.com/v2/datasets' \
--header 'Authorization: Key {{YOUR API KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "dataset_ids": ["{{dataset_id}}"]
}'
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://old-docs.clarifai.com/guide/api-guide/data/datasets/dataset-basics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
