API Reference - Menu Items

Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108111

← Back to API Reference | Getting Started

Menu Items

Menu Items are the individual links and entries within a Menu. Each item defines the label, URL, display order, parent relationship (for nested/dropdown items), and HTML attributes such as CSS classes and link target. Items are associated with a menu via menu_id.

Model name in URL: menu_items — DB table: menu_items

The Menu Item Object

FieldTypeDescription
menu_item_idintegerUnique menu item ID (primary key, read-only)
menu_nametextDisplay label for this menu item; may contain HTML or PHP template tags required on create
menu_linktextURL or path for this menu item's link (EG /about/contact); empty for non-linked labels required on create
master_idintegerID of the parent menu item for nested/dropdown items; 0 for top-level items required on create
menu_targetstringHTML target attribute for the link (EG _blank to open in a new tab)
menu_classstringCSS class applied to the anchor (<a>) element of this menu item
menu_li_classstringCSS class applied to the list item (<li>) element of this menu item
menu_stylestringInline CSS style applied to this menu item's element
menu_orderintegerSort order position within the parent menu or dropdown; lower numbers appear first required on create
menu_idintegerID of the parent Menu this item belongs to required on create
menu_displaystringWhether this item is displayed: 1 visible, 0 hidden
menu_name_2stringSecondary or alternate label for this menu item (used in some theme layouts)
menu_titlestringHTML title attribute for the link element (shown as a tooltip on hover)
menu_relstringHTML rel attribute for the link (EG nofollow)
revision_timestamptimestampTimestamp of the last modification to this record (auto-managed)
json_metatextJSON-encoded extended attributes for this menu item (EG extra anchor and list item classes); structure: {"menu_extra_a": "", "menu_extra_li": ""}

List Menu Items

GET /api/v2/menu_items/get

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/menu_items/get?limit=25" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "menu_item_id": "464",
      "menu_name": "",
      "menu_link": "",
      "master_id": "0",
      "menu_target": "",
      "menu_class": "bmargin",
      "menu_li_class": "bmargin xs-nomargin",
      "menu_style": "",
      "menu_order": "1",
      "menu_id": "62",
      "menu_display": "1",
      "menu_name_2": "",
      "menu_title": "",
      "menu_rel": "",
      "revision_timestamp": "2025-09-02 13:03:08",
      "json_meta": "{\"menu_extra_a\":\"\",\"menu_extra_li\":\"\"}"
    },
    {
      "menu_item_id": "465",
      "menu_name": " Contact",
      "menu_link": "/about/contact",
      "master_id": "0",
      "menu_target": "",
      "menu_class": "",
      "menu_li_class": "",
      "menu_style": "",
      "menu_order": "2",
      "menu_id": "62",
      "menu_display": "1",
      "menu_name_2": "",
      "menu_title": "",
      "menu_rel": "",
      "revision_timestamp": "2025-09-02 13:03:08",
      "json_meta": "{\"menu_extra_a\":\"\",\"menu_extra_li\":\"\"}"
    }
  ],
  "total": "2",
  "current_page": 1,
  "total_pages": 1
}

Retrieve a Menu Item

GET /api/v2/menu_items/get/{menu_item_id}

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/menu_items/get/464" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "menu_item_id": "464",
      "menu_name": "",
      "menu_link": "",
      "master_id": "0",
      "menu_target": "",
      "menu_class": "bmargin",
      "menu_li_class": "bmargin xs-nomargin",
      "menu_style": "",
      "menu_order": "1",
      "menu_id": "62",
      "menu_display": "1",
      "menu_name_2": "",
      "menu_title": "",
      "menu_rel": "",
      "revision_timestamp": "2025-09-02 13:03:08",
      "json_meta": "{\"menu_extra_a\":\"\",\"menu_extra_li\":\"\"}"
    }
  ],
  "total": "1",
  "current_page": 1,
  "total_pages": 1
}

Create a Menu Item

POST /api/v2/menu_items/create

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/menu_items/create" \
  -H "X-Api-Key: your-api-key-here" \
  -d "menu_id=62" \
  -d "menu_name=About+Us" \
  -d "menu_link=/about" \
  -d "master_id=0" \
  -d "menu_order=3" \
  -d "menu_display=1"

Example Response

Copy
{
  "status": "success",
  "message": {
    "menu_item_id": "466",
    "menu_name": "About Us",
    "menu_link": "/about",
    "master_id": "0",
    "menu_target": null,
    "menu_class": null,
    "menu_li_class": null,
    "menu_style": null,
    "menu_order": "3",
    "menu_id": "62",
    "menu_display": "1",
    "menu_name_2": null,
    "menu_title": null,
    "menu_rel": null,
    "revision_timestamp": null,
    "json_meta": null
  }
}

Update a Menu Item

PUT /api/v2/menu_items/update

Example Request

Copy
curl -X PUT "https://www.yourdomain.com/api/v2/menu_items/update" \
  -H "X-Api-Key: your-api-key-here" \
  -d "menu_item_id=466" \
  -d "menu_name=About+Our+Company" \
  -d "menu_order=2" \
  -d "menu_target=_blank"

Example Response

Copy
{
  "status": "success",
  "message": {
    "menu_item_id": "466",
    "menu_name": "About Our Company",
    "menu_link": "/about",
    "master_id": "0",
    "menu_target": "_blank",
    "menu_class": null,
    "menu_li_class": null,
    "menu_style": null,
    "menu_order": "2",
    "menu_id": "62",
    "menu_display": "1",
    "menu_name_2": null,
    "menu_title": null,
    "menu_rel": null,
    "revision_timestamp": "2026-04-03 10:00:00",
    "json_meta": null
  }
}

Delete a Menu Item

DELETE /api/v2/menu_items/delete

Example Request

Copy
curl -X DELETE "https://www.yourdomain.com/api/v2/menu_items/delete" \
  -H "X-Api-Key: your-api-key-here" \
  -d "menu_item_id=466"

Example Response

Copy
{
  "status": "success",
  "message": "menu_items record was deleted"
}