**Version: 202701**

# Update menu

**PUT** `/openapi/2027-01/menus/:id`

Update a menu's name and items. Built-in menus only allow a limited set of fields to change.

## Request

**Path Parameters**

- `id` string (required)

  Menu id to update

**application/json**

**Body | Example**

**Body (required)**

- `title` string

  New title. Optional; kept unchanged when omitted
- `category` int32

  Menu category (custom menu = `3`). Optional; `0` or omitted keeps the current value
- `children` object[]

  Menu items tree. When provided, it replaces all current items and existing items not included are deleted; omitted keeps the current items; an empty array clears all items

  *   Array \[

  - `id` int64

    ID of an existing item in this menu. When updating, passing it updates that item in place and keeps its ID; otherwise a new item is created. Ignored when creating a menu
  - `title` string

    Menu item title
  - `target` string

    Link target, e.g. `_blank` opens in a new window
  - `disabled` int32

    Whether the item is disabled: `1` disabled, `0` enabled
  - `url_obj` object

    Link of the item; omitted means no link

    - `type` string

      Link type, e.g. `home`, `product`, `collection`, `page`, `article`, `blog`, `web`; unrecognized values are saved as no link (`0`)
    - `source_id` string

      ID of the linked resource (product, collection, page, etc.)
    - `url` string

      Link URL
  - `children` undefined[]

    Child items; can be nested to any depth
  *   \]

```json
{
  "title": "string",
  "category": 0,
  "children": [
    {
      "id": 0,
      "title": "string",
      "target": "string",
      "disabled": 0,
      "url_obj": {
        "type": "string",
        "source_id": "string",
        "url": "string"
      },
      "children": [
        null
      ]
    }
  ]
}
```

## Responses

**200**

OK

**application/json**

**Schema | Example**

**Schema**

- `code` string

  error code
- `message` string

  error message
- `data` object

  - `menu` object

    Updated menu

    - `id` string

      Menu ID

```json
{
  "code": "string",
  "message": "string",
  "data": {
    "menu": {
      "id": "string"
    }
  }
}
```
