Show examples in:
Referenced records

List all records that link to a specific record

Query parameters

nested  Optional  boolean  Example: true

For Modular Content, Structured Text and Single Block fields, return full payload for nested blocks instead of IDs

version  Optional  null, enum  Example: "current"

Retrieve only the selected type of version that is linked to the record; current, published or both

Returns

Returns an array of item resource objects.

Examples

Example Basic example
import { buildClient } from '@datocms/cma-client-node';
async function run() {
const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });
const itemId = 'hWl-mnkWRYmMCSTq4z_piQ';
const items = await client.items.references(itemId);
items.forEach((item) => {
console.log(item);
});
}
run();