Content Management API > Schema Menu Item
Update a schema menu item
Body parameters
typestringRequired
Must be exactly "schema_menu_item".
JSON API type field
attributes.labelnull, stringOptional
The label of the schema menu item (only present when the schema menu item is not linked to an item type)
Example:
"Posts"
attributes.positionintegerOptional
Ordering index
Example:
1
attributes.kindenumOptional
Indicates if the schema menu item refers to an item type or a modular block
Example:
"item_type"
item_typeOptional
modular_blockOptional
relationships.item_type.dataOptional
Item type associated with the menu item
Type:<a href="/docs/content-management-api/resources/item_type">ResourceLinkage<"item_type"></a>, null
relationships.parent.dataOptional
Parent schema menu item
Type:null, <a href="/docs/content-management-api/resources/schema_menu_item">ResourceLinkage<"schema_menu_item"></a>
relationships.children.dataOptional
Underlying schema menu items
Type:Array<<a href="/docs/content-management-api/resources/schema_menu_item">ResourceLinkage<"schema_menu_item"></a>>
Returns
Returns a resource object of type schema_menu_item.
Examples
PUT https://site-api.datocms.com/schema-menu-items/:schema_menu_item_id HTTP/1.1Authorization: Bearer YOUR-API-TOKENAccept: application/jsonX-Api-Version: 3Content-Type: application/vnd.api+json
{ "data": { "type": "schema_menu_item", "id": "uinr2zfqQLeCo_1O0-ao-Q" }}curl -g 'https://site-api.datocms.com/schema-menu-items/:schema_menu_item_id' \ -X PUT \ -H "Authorization: Bearer YOUR-API-TOKEN" \ -H "Accept: application/json" \ -H "X-Api-Version: 3" \ -H "Content-Type: application/vnd.api+json" \ --data-binary '{"data":{"type":"schema_menu_item","id":"uinr2zfqQLeCo_1O0-ao-Q"}}'await fetch( "https://site-api.datocms.com/schema-menu-items/:schema_menu_item_id", { method: "PUT", headers: { Authorization: "Bearer YOUR-API-TOKEN", Accept: "application/json", "X-Api-Version": "3", "Content-Type": "application/vnd.api+json", }, body: JSON.stringify({ data: { type: "schema_menu_item", id: "uinr2zfqQLeCo_1O0-ao-Q" }, }), },);HTTP/1.1 200 OKContent-Type: application/jsonCache-Control: cache-control: max-age=0, private, must-revalidateX-RateLimit-Limit: 30X-RateLimit-Remaining: 28
{ "data": { "type": "schema_menu_item", "id": "uinr2zfqQLeCo_1O0-ao-Q", "relationships": { "item_type": { "data": { "type": "item_type", "id": "DxMaW10UQiCmZcuuA-IkkA" } }, "parent": { "data": null }, "children": { "data": [ { "type": "schema_menu_item", "id": "uinr2zfqQLeCo_1O0-ao-Q" } ] } }, "attributes": { "label": "Posts", "position": 1, "kind": "item_type" } }}