Name of the model
API key of the model
The way the model collection should be presented to the editors
Whether the model is single-instance or not
Whether we require all the project locales to be present for each localized field or not
Whether editors can sort records via drag & drop or not
Whether this model is a modular content block or not
Whether draft/published mode is active or not
Whether editors can organize records in a tree or not
If an ordering field is set, this fields specify the sorting direction
Specifies the model's sorting method. Cannot be set in concurrency with ordering_field
A hint shown to editors to help them understand the purpose of this model/block
Whether inverse relationships fields are expressed in GraphQL or not
If this model is single-instance, this tells the single-instance record has already been created or not
The field upon which the collection is sorted
The field to use as display title
The field to use as preview image
The field to use as fallback description for SEO purposes
The workflow to enforce on records
import { buildClient } from '@datocms/cma-client-node';async function run() {const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });const modelIdOrApiKey = 'blog_post';const itemType = await client.itemTypes.update(modelIdOrApiKey, {name: 'Blog post',api_key: 'post',collection_appearance: 'compact',singleton: false,all_locales_required: false,sortable: true,modular_block: false,draft_mode_active: false,tree: false,ordering_direction: null,ordering_meta: 'created_at',hint: 'Blog posts will be shown in our website under the Blog section',inverse_relationships_enabled: false,meta: {has_singleton_item: false},ordering_field: null,title_field: null,image_preview_field: null,excerpt_field: null,workflow: null});console.log(itemType);}run();
{id: 'DxMaW10UQiCmZcuuA-IkkA',name: 'Blog post',api_key: 'post',collection_appearance: 'compact',singleton: false,all_locales_required: false,sortable: true,modular_block: false,draft_mode_active: false,tree: false,ordering_direction: null,ordering_meta: 'created_at',hint: 'Blog posts will be shown in our website under the Blog section',inverse_relationships_enabled: false,meta: {has_singleton_item: false},singleton_item: null,fields: [{type: 'field',id: 'Pkg-oztERp6o-Rj76nYKJg'}],fieldsets: [{type: 'fieldset',id: '93Y1C2sySkG4Eg0atBRIwg'}],title_field: null,image_preview_field: null,excerpt_field: null,ordering_field: null,workflow: null}