---
title: "Delete Data Items By Key"
method: DELETE
path: "/collections/{collectionId}/itemsByKey"
tags: ["Data Item"]
---

# Delete Data Items By Key

`DELETE /collections/{collectionId}/itemsByKey`

## Request

- Base URL: `https://data.lucid.app`
- URL: `https://data.lucid.app/collections/{collectionId}/itemsByKey`
- Auth: OAuth 2
  - Authorization code: `https://lucid.app/oauth2/authorize`
  - Token URL: `https://api.lucid.co/oauth2/token` scopes: `data-service.admin`

Finds all the items whose key values match those specified by the payload and deletes them. The deletion cannot be undone. The deletion will only occur if the user has access to the data source.

## Path parameters

- `collectionId` integer, required

## Request body

- object
  - `targetValues` object[], required: Defines what items within the collection you are searching for. The order of strings in fieldValues must match that of either keySchemaFields or of the actual primary keys from the real schema if keySchemaFields is not defined.
    - `fieldValues` string[]: Specifies the actual value that the fields need to have to be found
  - `keySchemaFields` string[]: Fields used to search for items in the collection. If it is not provided, primary keys from the schema are used.

## Response `200`

OK

---

[API](https://skmtc.dev/lucid/apis/lucid-data-api.md) - [All operations](https://skmtc.dev/lucid/apis/lucid-data-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lucid/apis/lucid-data-api/revisions/c14ed29dbeab?raw)
