Dataset Basics
Create, explore and modify datasets

Create a dataset

cURL
1
curl --location --request POST 'api.clarifai.com/v2/datasets' \
2
--header 'Authorization: Key {{YOUR API KEY}}' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"datasets": [
6
{
7
"id": "dataset-1633032323",
8
"name": "foo",
9
"description": "This is the foo dataset",
10
"metadata": {
11
"lol": "hey"
12
}
13
}
14
]
15
}'
Copied!

List datasets

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

Get datasets

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

Update datasets

cURL
1
curl --location --request PATCH 'api.clarifai.com/v2/datasets' \
2
--header 'Authorization: Key {{YOUR API KEY}}' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"datasets": [
6
{
7
"id": "{{dataset_id}}",
8
"name": "foo",
9
"description": "This is the new foo dataset",
10
"metadata": {
11
"foo": "bar"
12
}
13
}
14
],
15
"action": "overwrite"
16
}'
Copied!

Update datasets with default filter

cURL
1
curl --location --request PATCH 'api.clarifai.com/v2/datasets' \
2
--header 'Authorization: Key {{YOUR API KEY}}' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"datasets": [
6
{
7
"id": "{{dataset_id}}",
8
"name": "foo",
9
"description": "This is the new foo dataset",
10
"metadata": {
11
"foo": "bar"
12
},
13
"default_filter_id": "{{dataset_filter_id}}"
14
}
15
],
16
"action": "overwrite"
17
}'
Copied!

Delete datasets

cURL
1
curl --location --request DELETE 'api.clarifai.com/v2/datasets' \
2
--header 'Authorization: Key {{YOUR API KEY}}' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"dataset_ids": ["{{dataset_id}}"]
6
}'
Copied!
Last modified 1mo ago