Show examples in:
Javascript HTTP

Content Management API > Model/Block

Model/Block

The way you define the kind of content you can edit inside your administrative area passes through the concept of Models, which are much like database tables. For backward-compatibility reasons, the API refers to models as "item types".

Object payload

id string

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

Example: "DxMaW10UQiCmZcuuA-IkkA"
type string

Must be exactly "item_type".

attributes.name string

Name of the model

Example: "Blog post"
attributes.api_key string

API key of the model

Example: "post"
attributes.singleton boolean

Whether the model is single-instance or not

attributes.sortable boolean

Whether editors can sort records via drag & drop or not

attributes.modular_block boolean

Whether this model is a modular content block or not

attributes.tree boolean

Whether editors can organize records in a tree or not

attributes.ordering_direction enum, null

If an ordering field is set, this fields specify the sorting direction

asc

Ascending order

desc

Descending order

attributes.ordering_meta enum, null

Specifies the model's sorting method. Cannot be set in concurrency with ordering_field

Example: "created_at"
created_at

Order by date of creation

updated_at

Order by date of last update

first_published_at

Order by date of first publication

published_at

Order by date of last publication

attributes.draft_mode_active boolean

Whether draft/published mode is active or not

attributes.all_locales_required boolean

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

attributes.collection_appearance enum

The way the model collection should be presented to the editors

Example: "compact"
compact

Compact view

table

Tabular view

attributes.hint string, null

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

Example: "Blog posts will be shown in our website under the Blog section"
attributes.inverse_relationships_enabled boolean

Whether inverse relationships fields are expressed in GraphQL or not

meta.has_singleton_item boolean

If this model is single-instance, this tells the single-instance record has already been created or not

relationships.singleton_item.data

The item instance related to this item type

relationships.fields.data

The list of item type fields

relationships.fieldsets.data

The list of item type fieldsets

relationships.title_field.data

The field to use as display title

relationships.image_preview_field.data

The field to use as preview image

relationships.excerpt_field.data

The field to use as fallback description for SEO purposes

relationships.ordering_field.data

The field upon which the collection is sorted

relationships.workflow.data

The workflow to enforce on records

attributes.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"
compact

Compact view

table

Tabular view

attributes.has_singleton_item boolean Deprecated

If this model is single-instance, this tells the single-instance record has already been created or not

This field will be removed in future versions: instead, use the equivalent has_singleton_item field in the meta collection

Available endpoints