Show examples in:
    Delete a model

    Returns

    Returns a item_type resource object.

    Examples

    Example code:
    import { buildClient } from '@datocms/cma-client-node';
    async function run() {
    const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });
    const modelIdOrApiKey = 'blog_post';
    const itemType = await client.itemTypes.destroy(modelIdOrApiKey);
    console.log(itemType);
    }
    run();
    Returned output:
    {
    id: '44',
    name: 'Blog post',
    api_key: 'post',
    collection_appearance: 'compact',
    singleton: false,
    all_locales_required: false,
    sortable: true,
    modular_block: false,
    draft_mode_active: false,
    tree: false,
    ordering_direction: null,
    ordering_meta: 'created_at',
    has_singleton_item: false,
    hint: 'Blog posts will be shown in our website under the Blog section',
    singleton_item: null,
    fields: [
    {
    type: 'field',
    id: '124'
    }
    ],
    fieldsets: [
    {
    type: 'fieldset',
    id: '124'
    }
    ],
    title_field: null,
    image_preview_field: null,
    excerpt_field: null,
    ordering_field: null,
    workflow: null
    }