Sorry, no results found for "".

Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Fieldset

Create a new fieldset

Body parameters

id string Optional

RFC 4122 UUID of fieldset expressed in URL-safe base64 format

Example: "93Y1C2sySkG4Eg0atBRIwg"
title string Required

The title of the fieldset

Example: "SEO-related fields"
hint string, null Optional

Description/contextual hint for the fieldset

Example: "Please fill in these fields!"
position integer Optional

Ordering index

Example: 1
collapsible boolean Optional

Whether the fieldset can be collapsed or not

start_collapsed boolean Optional

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

Returns

Returns a resource object of type fieldset

Examples

import { buildClient } from "@datocms/cma-client-node";
async function run() {
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const modelIdOrApiKey = "blog_post";
const fieldset = await client.fieldsets.create(modelIdOrApiKey, {
title: "SEO-related fields",
});
// Check the 'Returned output' tab for the result ☝️
console.log(fieldset);
}
run();
{
id: "93Y1C2sySkG4Eg0atBRIwg",
title: "SEO-related fields",
hint: "Please fill in these fields!",
position: 1,
collapsible: true,
start_collapsed: false,
item_type: { type: "item_type", id: "DxMaW10UQiCmZcuuA-IkkA" },
}