Show examples in:
Javascript HTTP
Endpoint info
Available examples
Content Management API > Record

Validates a record field

Warning: Experimental API

Please note that this API method is marked as unstable and should be avoided in production environments. Changes may occur at any time without warning, potentially impacting your scripts. We recommend contacting our Support Team to explore alternative approaches that are safer and more reliable!

Body parameters

item_type Required

The record's model

creator Optional

The entity (account/collaborator/access token/sso user) who created the record

Examples

import { buildClient } from "@datocms/cma-client-node";
async function run() {
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
await client.items.validateNew({
title: "My first blog post!",
content: "Lorem ipsum dolor sit amet...",
category: "24",
image: {
upload_id: "WxrWMPl3TjeSJYcl6lNCbg",
alt: "Alt text",
title: "Image title",
custom_data: {},
},
item_type: { type: "item_type", id: "DxMaW10UQiCmZcuuA-IkkA" },
});
}
run();