> 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 %}
