Choose your language:
    List all models
    Returns
    Returns an array of item_type objects.

    Examples

    Example code:
    const SiteClient = require('datocms-client').SiteClient;
    const client = new SiteClient('YOUR-API-TOKEN');
    client.itemTypes.all()
    .then((itemTypes) => {
    itemTypes.forEach((itemType) => {
    console.log(itemType);
    });
    })
    .catch((error) => {
    console.error(error);
    });
    Returned output:
    > 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
    }