# Create a new model/block model

## Query parameters

skip\_menu\_item\_creation boolean

Skip the creation of a menu item linked to the model

menu\_item\_id string

Explicitely specify the ID of the menu item that will be linked to the model

Example: `"FF-P5of6Qp-DD2w0xoaa6Q"`

schema\_menu\_item\_id string

Explicitely specify the ID of the schema menu item that will be linked to the model

Example: `"FF-P5of6Qp-DD2w0xoaa6Q"`

## Body parameters

id string Optional

RFC 4122 UUID of item type expressed in URL-safe base64 format

Example: `"DxMaW10UQiCmZcuuA-IkkA"`

name string Required

Name of the model/block model

Example: `"Blog post"`

api\_key string Required

API key of the model/block model

Example: `"post"`

singleton boolean Optional

Whether the model is single-instance or not. This property only applies to models, not block models

all\_locales\_required boolean Optional

Whether we require all the project locales to be present for each localized field or not

sortable boolean Optional

Whether editors can sort records via drag & drop or not. Must be false for block models

modular\_block boolean Optional

Whether this is a block model or not. Block models define structures that can be embedded inside records, while regular models create standalone records

draft\_mode\_active boolean Optional

Whether draft/published mode is active or not. Must be false for block models

draft\_saving\_active boolean Optional

Whether draft records can be saved without satisfying the validations or not. Must be false for block models

tree boolean Optional

Whether editors can organize records in a tree or not. Must be false for block models

ordering\_direction enum, null Optional

If an ordering field is set, this field specifies the sorting direction. This property does not apply to block models

Show enum values

asc Optional

Ascending order

desc Optional

Descending order

ordering\_meta enum, null Optional

Specifies the model's sorting method. Cannot be set in concurrency with ordering\_field. This property does not apply to block models

Example: `"created_at"`

Show enum values

created\_at Optional

Order by date of creation

updated\_at Optional

Order by date of last update

first\_published\_at Optional

Order by date of first publication

published\_at Optional

Order by date of last publication

collection\_appearance enum Optional

The way the model/block model collection should be presented to the editors

Example: `"compact"`

Show enum values

compact Optional

Compact view

table Optional

Tabular view

hint string, null Optional

A hint shown to editors to help them understand the purpose of this model/block model

Example: `"Blog posts will be shown in our website under the Blog section"`

inverse\_relationships\_enabled boolean Optional

Whether inverse relationships fields are expressed in GraphQL or not. Must be false for block models

ordering\_field Optional

The field upon which the collection is sorted. This relationship does not apply to block models

Type: [ResourceLinkage<"field"\>](https://www.datocms.com/docs/content-management-api/resources/field.md), null

presentation\_title\_field Optional

The field to use as presentation title

Type: [ResourceLinkage<"field"\>](https://www.datocms.com/docs/content-management-api/resources/field.md), null

presentation\_image\_field Optional

The field to use as presentation image

Type: [ResourceLinkage<"field"\>](https://www.datocms.com/docs/content-management-api/resources/field.md), null

title\_field Optional

The field to use as fallback title for SEO purposes. This relationship does not apply to block models

Type: [ResourceLinkage<"field"\>](https://www.datocms.com/docs/content-management-api/resources/field.md), null

image\_preview\_field Optional

The field to use as fallback image for SEO purposes. This relationship does not apply to block models

Type: [ResourceLinkage<"field"\>](https://www.datocms.com/docs/content-management-api/resources/field.md), null

excerpt\_field Optional

The field to use as fallback description for SEO purposes. This relationship does not apply to block models

Type: [ResourceLinkage<"field"\>](https://www.datocms.com/docs/content-management-api/resources/field.md), null

workflow Optional

The workflow to enforce on records

Type: [ResourceLinkage<"workflow"\>](https://www.datocms.com/docs/content-management-api/resources/workflow.md), null

Show deprecated

collection\_appeareance enum Deprecated

The way the model collection should be presented to the editors

This field contains a typo and will be removed in future versions: use `collection_appearance` instead

Example: `"compact"`

Show enum values

compact Optional

Compact view

table Optional

Tabular view

## Returns

Returns a resource object of type [item\_type](https://www.datocms.com/docs/content-management-api/resources/item-type.md)

## Examples

Example Basic example

###### Code

```javascript
import { buildClient } from "@datocms/cma-client-node";

async function run() {
  const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });

  const itemType = await client.itemTypes.create({
    name: "Blog post",
    api_key: "post",
  });

  // Check the 'Returned output' tab for the result ☝️
  console.log(itemType);
}

run();
```

###### Returned output

```javascript
{
  id: "DxMaW10UQiCmZcuuA-IkkA",
  name: "Blog post",
  api_key: "post",
  singleton: false,
  sortable: true,
  modular_block: false,
  tree: false,
  ordering_direction: null,
  ordering_meta: "created_at",
  draft_mode_active: false,
  all_locales_required: false,
  collection_appearance: "compact",
  hint: "Blog posts will be shown in our website under the Blog section",
  inverse_relationships_enabled: false,
  draft_saving_active: false,
  meta: { has_singleton_item: false },
  singleton_item: null,
  fields: [{ type: "field", id: "Pkg-oztERp6o-Rj76nYKJg" }],
  fieldsets: [{ type: "fieldset", id: "93Y1C2sySkG4Eg0atBRIwg" }],
  presentation_title_field: null,
  presentation_image_field: null,
  title_field: null,
  image_preview_field: null,
  excerpt_field: null,
  ordering_field: null,
  workflow: null,
}
```

## Related content in "Content Management API"

- [Content Management API Overview](https://www.datocms.com/docs/content-management-api.md)

- [Using the JavaScript client](https://www.datocms.com/docs/content-management-api/using-the-nodejs-clients.md)
- [API versioning](https://www.datocms.com/docs/content-management-api/api-versioning.md)

- [Authentication](https://www.datocms.com/docs/content-management-api/authentication.md)
- [Environments](https://www.datocms.com/docs/content-management-api/setting-the-environment.md)

- [Error codes & handling failures (CMA)](https://www.datocms.com/docs/content-management-api/errors.md)
- [Pagination](https://www.datocms.com/docs/content-management-api/pagination.md)

- [Asynchronous jobs](https://www.datocms.com/docs/content-management-api/async-jobs.md)
- [Technical Limits (CMA)](https://www.datocms.com/docs/content-management-api/technical-limits.md)

- [Record](https://www.datocms.com/docs/content-management-api/resources/item.md)
- [Scheduled publication](https://www.datocms.com/docs/content-management-api/resources/scheduled-publication.md)

- [Scheduled unpublishing](https://www.datocms.com/docs/content-management-api/resources/scheduled-unpublishing.md)
- [Upload](https://www.datocms.com/docs/content-management-api/resources/upload.md)

- [Site](https://www.datocms.com/docs/content-management-api/resources/site.md)
- [Model/Block model](https://www.datocms.com/docs/content-management-api/resources/item-type.md)

- [Create a new model/block model](https://www.datocms.com/docs/content-management-api/resources/item-type/create.md)
- [Update a model/block model](https://www.datocms.com/docs/content-management-api/resources/item-type/update.md)

- [List all models/block models](https://www.datocms.com/docs/content-management-api/resources/item-type/instances.md)
- [Retrieve a model/block model](https://www.datocms.com/docs/content-management-api/resources/item-type/self.md)

- [Duplicate model/block model](https://www.datocms.com/docs/content-management-api/resources/item-type/duplicate.md)
- [Delete a model/block model](https://www.datocms.com/docs/content-management-api/resources/item-type/destroy.md)

- [List models referencing another model/block](https://www.datocms.com/docs/content-management-api/resources/item-type/referencing.md)
- [Field](https://www.datocms.com/docs/content-management-api/resources/field.md)

- [Fieldset](https://www.datocms.com/docs/content-management-api/resources/fieldset.md)
- [Record version](https://www.datocms.com/docs/content-management-api/resources/item-version.md)

- [Upload permission](https://www.datocms.com/docs/content-management-api/resources/upload-request.md)
- [Upload track](https://www.datocms.com/docs/content-management-api/resources/upload-track.md)

- [Manual tags](https://www.datocms.com/docs/content-management-api/resources/upload-tag.md)
- [Smart tags](https://www.datocms.com/docs/content-management-api/resources/upload-smart-tag.md)

- [Upload Collection](https://www.datocms.com/docs/content-management-api/resources/upload-collection.md)
- [Search Index](https://www.datocms.com/docs/content-management-api/resources/search-index.md)

- [Search result](https://www.datocms.com/docs/content-management-api/resources/search-result.md)
- [Search indexing activity](https://www.datocms.com/docs/content-management-api/resources/search-index-event.md)

- [Environment](https://www.datocms.com/docs/content-management-api/resources/environment.md)
- [Maintenance mode](https://www.datocms.com/docs/content-management-api/resources/maintenance-mode.md)

- [Menu Item](https://www.datocms.com/docs/content-management-api/resources/menu-item.md)
- [Schema Menu Item](https://www.datocms.com/docs/content-management-api/resources/schema-menu-item.md)

- [Uploads filter](https://www.datocms.com/docs/content-management-api/resources/upload-filter.md)
- [Model filter](https://www.datocms.com/docs/content-management-api/resources/item-type-filter.md)

- [Plugin](https://www.datocms.com/docs/content-management-api/resources/plugin.md)
- [Workflow](https://www.datocms.com/docs/content-management-api/resources/workflow.md)

- [Asynchronous job](https://www.datocms.com/docs/content-management-api/resources/job.md)
- [Job result](https://www.datocms.com/docs/content-management-api/resources/job-result.md)

- [Account](https://www.datocms.com/docs/content-management-api/resources/account.md)
- [Organization](https://www.datocms.com/docs/content-management-api/resources/organization.md)

- [Invitation](https://www.datocms.com/docs/content-management-api/resources/site-invitation.md)
- [Collaborator](https://www.datocms.com/docs/content-management-api/resources/user.md)

- [Role](https://www.datocms.com/docs/content-management-api/resources/role.md)
- [API token](https://www.datocms.com/docs/content-management-api/resources/access-token.md)

- [Webhook](https://www.datocms.com/docs/content-management-api/resources/webhook.md)
- [Webhook call](https://www.datocms.com/docs/content-management-api/resources/webhook-call.md)

- [Build trigger](https://www.datocms.com/docs/content-management-api/resources/build-trigger.md)
- [Deploy activity](https://www.datocms.com/docs/content-management-api/resources/build-event.md)

- [Subscription limit](https://www.datocms.com/docs/content-management-api/resources/subscription-limit.md)
- [Subscription feature](https://www.datocms.com/docs/content-management-api/resources/subscription-feature.md)

- [SSO Settings](https://www.datocms.com/docs/content-management-api/resources/sso-settings.md)
- [SSO User](https://www.datocms.com/docs/content-management-api/resources/sso-user.md)

- [SSO Group](https://www.datocms.com/docs/content-management-api/resources/sso-group.md)
- [White-label settings](https://www.datocms.com/docs/content-management-api/resources/white-label-settings.md)

- [Audit log event](https://www.datocms.com/docs/content-management-api/resources/audit-log-event.md)