Show examples in:
    Validates an existing record field

    Body Parameters

    id  string  Required
    RFC 4122 UUID of record expressed in URL-safe base64 format
    item_type  Required  { type: "item_type", id: item_type.id }

    The record's model

    creator  Optional  { type: "account", id: account.id }, { type: "access_token", id: access_token.id }, { type: "user", id: user.id }, { type: "sso_user", id: sso_user.id }, { type: "organization", id: organization.id }

    The entity (account/collaborator/access token/sso user) who created the record. It must be an object with type (e.g. 'account') and id properties.

    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';
    await client.items.validateExisting(itemId, {
    id: 'hWl-mnkWRYmMCSTq4z_piQ',
    title: 'My first blog post!',
    content: 'Lorem ipsum dolor sit amet...',
    category: '24',
    image: {
    upload_id: '1235',
    alt: 'Alt text',
    title: 'Image title',
    custom_data: {}
    },
    item_type: {
    type: 'item_type',
    id: 'DxMaW10UQiCmZcuuA-IkkA'
    }
    });
    }
    run();