Dataset Filters
Use filter and search functionality over your datasets

Add dataset filters

cURL
1
curl --location -g --request POST 'api.clarifai.com/v2/datasets/{{dataset_id}}/filters' \
2
--header 'Authorization: Key {{YOUR API KEY}}' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"dataset_filters": [
6
{
7
"id": "dataset-filter-1633032596",
8
"name": "foo",
9
"saved_search": {
10
"id": "{{search_id}}"
11
}
12
}
13
]
14
}'
Copied!

List dataset Filters

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

Get a dataset filter

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

Change a dataset filter

cURL
1
curl --location -g --request PATCH 'api.clarifai.com/v2/datasets/{{dataset_id}}/filters' \
2
--header 'Authorization: Key {{YOUR API KEY}}' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"dataset_filters": [
6
{
7
"id": "{{dataset_filter_id}}",
8
"name": "foo bar",
9
"saved_search_id": "{{search_id}}"
10
}
11
],
12
"action": "overwrite"
13
}'
Copied!

Delete a dataset filter

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