Body parameters

namestringrequired

The name of the menu.

handlestringrequired

The unique slug of the menu.

itemsarray

The list of items in the menu.

items.*.labelstringrequired

The label for the menu item.

items.*.urlstringrequired

The URL for the menu item.

items.*.activeboolean

Whether the menu item is active or not.

items.*.is_new_tabboolean

Whether the menu item should open in a new tab or not.

Response

idstring

The unique identifier for this menu.

objectstring

This will always contain menu for this endpoint.

namestring

The name of this menu.

handlestring

The unique slug for this menu.

itemsarray

The items of this menu.

items.*.idstring

The unique identifier for the menu item.

items.*.objectstring

This will always contain menu_item.

items.*.labelstring

This label for the menu item.

items.*.urlstring

The URL for the menu item.

items.*.activestring

Whether the menu item is active or not.

items.*.is_new_tabstring

Whether the menu item should open in a new tab or not.

items.*.orderstring

The order of the menu item in the list.

items.*.itemsstring

The submenu items for this menu item.

items.*.created_atstring

The menu item's created at timestamp.

items.*.updated_atstring

The menu item's created at timestamp.

created_attimestamp

The menu's created at timestamp.

updated_attimestamp

The menu's updated at timestamp.

import Blutui from 'blutui'

const blutui = new Blutui('ey....')

blutui.project('one').admin.menus.create({
  name: 'Primary Menu',
  handle: 'primary-menu',
  items: [
    {
      label: 'About',
      url: '/about',
      isNewTab: false,
      active: true,
    },
  ],
})
Response
{
  "id": "9a5b0b29-a4f8-4df6-bf53-f282af312686",
  "object": "menu",
  "name": "Primary Menu",
  "handle": "primary-menu",
  "items": [
    {
      "id": "9a5b0b29-a5f4-4171-b50f-d0f6b61730e6",
      "object": "menu_item",
      "label": "About",
      "url": "/about",
      "active": true,
      "is_new_tab": false,
      "order": 0,
      "items": [],
      "created_at": 1711305486,
      "updated_at": 1711305486
    }
  ],
  "created_at": 1711305486,
  "updated_at": 1711305486
}

Was this helpful?