---
title: "Get Data Items By Key"
method: POST
path: "/collections/{collectionId}/items/{dataItemId}"
tags: ["Data Item"]
---

# Get Data Items By Key

`POST /collections/{collectionId}/items/{dataItemId}`

## Request

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

Returns all data items in the specified collection whose field values match the values specified in a Data Item By Key Find JSON Object. If necessary, you can paginate this endpoint's results using query parameters.
Note: For more complex data item search queries, consider using the filter parameter with Get All Data Items.

## Path parameters

- `collectionId` integer, required
- `dataItemId` integer, required

## Query parameters

- `start` integer
- `end` integer

## Request body

- object
  - `targetValues` object[], required: List of parameters by which to search for data items
    - `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 with paginated list of Data Items

- object
  - `items` object[]: List of data items
    - `uri` string, required: Link to self
    - `collection` string, required: Link to the collection the item belongs to
    - `fields` object, required: Mapping of field names found in schema to this specific item's values
  - `total` integer: Total number of data items in the collection
  - `prev` string: Link to get the previous set of data items
  - `next` string: Link to get the next set of data items

---

[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)
