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').SiteClient;
    const client = new SiteClient('YOUR-API-TOKEN');
    const modelIdOrApiKey = 'blog_post';
    client.fieldset.create(modelIdOrApiKey, {
    title: 'SEO-related fields',
    hint: 'Please fill in these fields!',
    position: 1,
    collapsible: true,
    startCollapsed: false
    })
    .then((fieldset) => {
    console.log(fieldset);
    })
    .catch((error) => {
    console.error(error);
    });
    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"
    }