Dataset Filters

Use filter and search functionality over your datasets

Add dataset filters

curl --location -g --request POST 'api.clarifai.com/v2/datasets/{{dataset_id}}/filters' \
--header 'Authorization: Key {{YOUR API KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "dataset_filters": [
        {
            "id": "dataset-filter-1633032596",
            "name": "foo",
            "saved_search": {
                "id": "{{search_id}}"
            }
        }
    ]
}'

List dataset Filters

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

Get a dataset filter

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

Change a dataset filter

curl --location -g --request PATCH 'api.clarifai.com/v2/datasets/{{dataset_id}}/filters' \
--header 'Authorization: Key {{YOUR API KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "dataset_filters": [
        {
            "id": "{{dataset_filter_id}}",
            "name": "foo bar",
            "saved_search_id": "{{search_id}}"
        }
    ],
    "action": "overwrite"
}'

Delete a dataset filter

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

Last updated