---
title: "Delete dataset items"
method: POST
path: "/v1/private/datasets/items/delete"
tags: ["Datasets"]
---

# Delete dataset items

`POST /v1/private/datasets/items/delete`

Delete dataset items using one of two modes:
1. **Delete by IDs**: Provide 'item_ids' to delete specific items by their IDs
2. **Delete by filters**: Provide 'dataset_id' with optional 'filters' to delete items matching criteria

When using filters, an empty 'filters' array will delete all items in the specified dataset.

## Request body

- DatasetItemsDelete — Request to delete multiple dataset items
  - `item_ids` string[] — List of dataset item IDs to delete (max 1000). Use this to delete specific items by their IDs. Mutually exclusive with 'dataset_id' and 'filters'.
  - `dataset_id` string, uuid — Dataset ID to scope the deletion. Required when using 'filters'. Mutually exclusive with 'item_ids'.
  - `filters` DatasetItemFilter[] — Filters to select dataset items to delete within the specified dataset. Must be used with 'dataset_id'. Mutually exclusive with 'item_ids'. Empty array means 'delete all items in the dataset'.
    - `field` string
    - `operator` 'contains' | 'not_contains' | 'starts_with' | 'ends_with' | '=' | '!=' | '>' | '>=' | '<' | '<=' | 'is_empty' | 'is_not_empty' | 'in' | 'not_in'
    - `key` string
    - `value` string
  - `batch_group_id` string, uuid — Optional batch group ID to group multiple delete operations into a single dataset version. If null, mutates the latest version instead of creating a new one.

## Response `204`

No content

## Other responses

- `400` — Bad request - invalid parameters or conflicting fields

---

[API](https://skmtc.net/comet-ml/apis/opik-rest-api.md) · [All operations](https://skmtc.net/comet-ml/apis/opik-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/comet-ml/opik-rest-api/versions/4ed2fbc97cc3/schema)
