Choose your language:
    Create a new fieldset
    Parameters
    title  string  Optional

    The title of the fieldset

    hint  string, null  Optional

    Description/contextual hint for the fieldset

    position  integer  Optional

    Ordering index

    collapsible  boolean  Optional

    Whether the fieldset can be collapsed or not

    startCollapsed  boolean  Optional

    When fieldset is collapsible, determines if the default is to start collapsed or not

    Returns
    Returns a fieldset object.

    Examples

    Example code:
    const { SiteClient } = require('datocms-client');
    async function run() {
    const client = new SiteClient('YOUR-API-TOKEN');
    const modelIdOrApiKey = 'blog_post';
    const fieldset = await client.fieldset.create(modelIdOrApiKey, {
    title: 'SEO-related fields',
    hint: 'Please fill in these fields!',
    position: 1,
    collapsible: true,
    startCollapsed: false
    });
    console.log(fieldset);
    }
    run();
    Returned output:
    > node example.js
    {
    "id": "124",
    "title": "SEO-related fields",
    "hint": "Please fill in these fields!",
    "collapsible": true,
    "startCollapsed": false,
    "position": 1,
    "itemType": "44"
    }