Show examples in:
List all record versions

Query parameters

nested  Optional  boolean  Example: true

For Modular Content, Structured Text and Single Block fields. If set, returns full payload for nested blocks instead of IDs

page  Optional  object

Parameters to control offset-based pagination

Returns

Returns an array of item_version 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 = '59JSonvYTCOUDz_b7_6hvA';
// this only returns the first page of results:
const itemVersions = await client.itemVersions.list(itemId);
itemVersions.forEach((itemVersion) => {
console.log(itemVersion);
});
// this iterates over every page of results:
for await (const itemVersion of client.itemVersions.listPagedIterator(
itemId
)) {
console.log(itemVersion);
}
}
run();