Name of the model
API key of the model
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
The way the model collection should be presented to the editors
A hint shown to editors to help them understand the purpose of this model/block
The field upon which the collection is sorted
The field to use as display title
The workflow to enforce on records
const SiteClient = require('datocms-client').SiteClient;const client = new SiteClient('YOUR-API-TOKEN');client.itemType.create({name: 'Blog post',apiKey: 'post',singleton: false,allLocalesRequired: false,sortable: true,modularBlock: false,draftModeActive: false,tree: false,orderingDirection: null,orderingMeta: 'created_at',collectionAppearance: 'compact',hint: 'Blog posts will be shown in our website under the Blog section',orderingField: null,titleField: null,workflow: null}).then((itemType) => {console.log(itemType);}).catch((error) => {console.error(error);});
> node example.js{"id": "44","name": "Blog post","apiKey": "post","collectionAppearance": "compact","singleton": false,"allLocalesRequired": false,"sortable": true,"modularBlock": false,"draftModeActive": false,"tree": false,"orderingDirection": null,"orderingMeta": "created_at","hasSingletonItem": false,"hint": "Blog posts will be shown in our website under the Blog section","singletonItem": null,"fields": ["124"],"titleField": null,"orderingField": null,"workflow": null}