Create a new model/block model
Query parameters
Skip the creation of a menu item linked to the model
Explicitely specify the ID of the menu item that will be linked to the model
"FF-P5of6Qp-DD2w0xoaa6Q"
Explicitely specify the ID of the schema menu item that will be linked to the model
"FF-P5of6Qp-DD2w0xoaa6Q"
Body parameters
RFC 4122 UUID of item type expressed in URL-safe base64 format
"DxMaW10UQiCmZcuuA-IkkA"
Must be exactly "item_type".
Name of the model/block model
"Blog post"
API key of the model/block model
"post"
Whether the model is single-instance or not. This property only applies to models, not block models
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. Must be false for block models
Whether this is a block model or not. Block models define structures that can be embedded inside records, while regular models create standalone records
Whether draft/published mode is active or not. Must be false for block models
Whether draft records can be saved without satisfying the validations or not. Must be false for block models
Whether editors can organize records in a tree or not. Must be false for block models
If an ordering field is set, this field specifies the sorting direction. This property does not apply to block models
Ascending order
Descending order
Specifies the model's sorting method. Cannot be set in concurrency with ordering_field. This property does not apply to block models
"created_at"
Order by date of creation
Order by date of last update
Order by date of first publication
Order by date of last publication
The way the model/block model collection should be presented to the editors
"compact"
Compact view
Tabular view
A hint shown to editors to help them understand the purpose of this model/block model
"Blog posts will be shown in our website under the Blog section"
Whether inverse relationships fields are expressed in GraphQL or not. Must be false for block models
The field upon which the collection is sorted. This relationship does not apply to block models
The field to use as presentation title
The field to use as presentation image
The field to use as fallback title for SEO purposes. This relationship does not apply to block models
The field to use as fallback image for SEO purposes. This relationship does not apply to block models
The field to use as fallback description for SEO purposes. This relationship does not apply to block models
The workflow to enforce on records
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
"compact"
Compact view
Tabular view
Returns
Returns a resource object of type item_type.
Examples
POST https://site-api.datocms.com/item-types HTTP/1.1Authorization: Bearer YOUR-API-TOKENAccept: application/jsonX-Api-Version: 3Content-Type: application/vnd.api+json
{ "data": { "type": "item_type", "attributes": { "name": "Blog post", "api_key": "post" } }}curl -g 'https://site-api.datocms.com/item-types' \ -X POST \ -H "Authorization: Bearer YOUR-API-TOKEN" \ -H "Accept: application/json" \ -H "X-Api-Version: 3" \ -H "Content-Type: application/vnd.api+json" \ --data-binary '{"data":{"type":"item_type","attributes":{"name":"Blog post","api_key":"post"}}}'await fetch("https://site-api.datocms.com/item-types", { method: "POST", headers: { Authorization: "Bearer YOUR-API-TOKEN", Accept: "application/json", "X-Api-Version": "3", "Content-Type": "application/vnd.api+json", }, body: JSON.stringify({ data: { type: "item_type", attributes: { name: "Blog post", api_key: "post" }, }, }),});HTTP/1.1 200 OKContent-Type: application/jsonCache-Control: cache-control: max-age=0, private, must-revalidateX-RateLimit-Limit: 30X-RateLimit-Remaining: 28
{ "data": { "type": "item_type", "id": "DxMaW10UQiCmZcuuA-IkkA", "relationships": { "singleton_item": { "data": null }, "fields": { "data": [ { "type": "field", "id": "Pkg-oztERp6o-Rj76nYKJg" } ] }, "fieldsets": { "data": [ { "type": "fieldset", "id": "93Y1C2sySkG4Eg0atBRIwg" } ] }, "presentation_title_field": { "data": null }, "presentation_image_field": { "data": null }, "title_field": { "data": null }, "image_preview_field": { "data": null }, "excerpt_field": { "data": null }, "ordering_field": { "data": null }, "workflow": { "data": null } }, "attributes": { "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 } }}