# Create a new model/block model

## Query parameters

**`skip_menu_item_creation`**

- Type: boolean

Skip the creation of a menu item linked to the model

**`menu_item_id`**

- Type: string
- Example: `"FF-P5of6Qp-DD2w0xoaa6Q"`

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

**`schema_menu_item_id`**

- Type: string
- Example: `"FF-P5of6Qp-DD2w0xoaa6Q"`

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

## Body parameters

**`id`**

- Optional
- Type: string
- Example: `"DxMaW10UQiCmZcuuA-IkkA"`

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

**`name`**

- Required
- Type: string
- Example: `"Blog post"`

Name of the model/block model

**`api_key`**

- Required
- Type: string
- Example: `"post"`

API key of the model/block model

**`singleton`**

- Optional
- Type: boolean

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

**`all_locales_required`**

- Optional
- Type: boolean

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

**`sortable`**

- Optional
- Type: boolean

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

**`modular_block`**

- Optional
- Type: boolean

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`**

- Optional
- Type: boolean

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

**`draft_saving_active`**

- Optional
- Type: boolean

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

**`tree`**

- Optional
- Type: boolean

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

**`ordering_direction`**

- Optional
- Type: enum, null

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

<details>
<summary>Show enum values</summary>

**`asc`**

- Optional

Ascending order

**`desc`**

- Optional

Descending order

</details>

**`ordering_meta`**

- Optional
- Type: enum, null
- Example: `"created_at"`

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

<details>
<summary>Show enum values</summary>

**`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

</details>

**`collection_appearance`**

- Optional
- Type: enum
- Example: `"compact"`

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

<details>
<summary>Show enum values</summary>

**`compact`**

- Optional

Compact view

**`table`**

- Optional

Tabular view

</details>

**`hint`**

- Optional
- Type: string, null
- Example: `"Blog posts will be shown in our website under the Blog section"`

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

**`inverse_relationships_enabled`**

- Optional
- Type: boolean

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

**`ordering_field`**

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

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

**`presentation_title_field`**

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

The field to use as presentation title

**`presentation_image_field`**

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

The field to use as presentation image

**`title_field`**

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

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

**`image_preview_field`**

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

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

**`excerpt_field`**

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

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

**`workflow`**

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

The workflow to enforce on records

<details>
<summary>Show deprecated</summary>

**`collection_appeareance`**

- Deprecated
- Type: enum
- Example: `"compact"`

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

<details>
<summary>Show enum values</summary>

**`compact`**

- Optional

Compact view

**`table`**

- Optional

Tabular view

</details>

</details>

## 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 CMA 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)
- [CMA Technical Limits & Rate Limits](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)