Show examples in:
JavascriptHTTP
Endpoint info
Available examples
Content Management API > Record version

List all record versions

Query parameters

nestedboolean

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

pageobject

Parameters to control offset-based pagination

offsetinteger

The (zero-based) offset of the first entity returned in the collection (defaults to 0)

Example:200
limitinteger

The maximum number of entities to return (defaults to 15, maximum is 50)

Returns

Returns an array of resource objects of type item_version

Examples

import { buildClient } from "@datocms/cma-client-node";
async function run() {
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const itemId = "59JSonvYTCOUDz_b7_6hvA";
// iterates over every page of results
for await (const itemVersion of client.itemVersions.listPagedIterator(
itemId,
)) {
// Check the 'Returned output' tab for the result ☝️
console.log(itemVersion);
}
}
run();