Show examples in:
    List all fieldsets

    Returns

    Returns an array of fieldset resource objects.

    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 fieldsets = await client.fieldsets.list(modelIdOrApiKey);
    fieldsets.forEach((fieldset) => {
    console.log(fieldset);
    });
    }
    run();
    Returned output:
    {
    id: '93Y1C2sySkG4Eg0atBRIwg',
    title: 'SEO-related fields',
    hint: 'Please fill in these fields!',
    collapsible: true,
    start_collapsed: false,
    position: 1,
    item_type: {
    type: 'item_type',
    id: 'DxMaW10UQiCmZcuuA-IkkA'
    }
    }