Skip to main content

Menus API

The Menus API provides endpoints for managing menus and menu items in Joomla.

Base URL

/api/index.php/v1/menus

Endpoints Overview

MethodEndpointDescription
GET/menus/siteRetrieve all menus
GET/menus/site/{id}Retrieve specific menu
POST/menus/siteCreate new menu
PATCH/menus/site/{id}Update menu
DELETE/menus/site/{id}Delete menu
MethodEndpointDescription
GET/menus/site/itemsRetrieve all menu items
GET/menus/site/items/{id}Retrieve specific item
POST/menus/site/itemsCreate new menu item
PATCH/menus/site/items/{id}Update menu item
DELETE/menus/site/items/{id}Delete menu item

Retrieve all menus

GET /api/index.php/v1/menus/site

Response

{
"data": [
{
"type": "menus",
"id": "1",
"attributes": {
"menutype": "mainmenu",
"title": "Main Menu",
"description": "The main menu of the site"
}
}
]
}

Create menu

POST /api/index.php/v1/menus/site

Request Body

{
"menutype": "footermenu",
"title": "Footer Menu",
"description": "Menu items in the footer"
}

Required fields

FieldTypeDescription
menutypestringUnique identifier for menu
titlestringMenu title

Example

curl -X POST "https://yoursite.com/api/index.php/v1/menus/site" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"menutype": "footermenu",
"title": "Footer Menu"
}'

Retrieve all menu items

GET /api/index.php/v1/menus/site/items

Response

{
"data": [
{
"type": "menu-items",
"id": "101",
"attributes": {
"title": "Home",
"alias": "home",
"menutype": "mainmenu",
"type": "component",
"link": "index.php?option=com_content&view=featured",
"published": 1,
"parent_id": 1,
"level": 1,
"component_id": 22,
"language": "*"
}
}
]
}

Create menu item

POST /api/index.php/v1/menus/site/items

Request Body for article link

{
"title": "About Us",
"alias": "about-us",
"menutype": "mainmenu",
"type": "component",
"link": "index.php?option=com_content&view=article&id=1",
"parent_id": 1,
"published": 1,
"access": 1,
"language": "*"
}

Request Body for external URL

{
"title": "External Link",
"alias": "external-link",
"menutype": "mainmenu",
"type": "url",
"link": "https://example.com",
"parent_id": 1,
"published": 1
}

Request Body for separator

{
"title": "---",
"menutype": "mainmenu",
"type": "separator",
"parent_id": 1
}

Required fields

FieldTypeDescription
titlestringMenu item title
menutypestringMenu the item belongs to
typestringType (component/url/separator)
linkstringLink URL (except separator)

Optional fields

FieldTypeDefaultDescription
aliasstringautoURL-friendly name
parent_idint1Parent menu item ID
publishedint1Publication status
accessint1Access level
languagestring"*"Language code
browserNavint0Open in: 0=same, 1=new

Example

curl -X POST "https://yoursite.com/api/index.php/v1/menus/site/items" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Contact",
"alias": "contact",
"menutype": "mainmenu",
"type": "component",
"link": "index.php?option=com_contact&view=contact&id=1",
"published": 1
}'

Update menu item

PATCH /api/index.php/v1/menus/site/items/{id}

Example

curl -X PATCH "https://yoursite.com/api/index.php/v1/menus/site/items/101" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "New Title",
"published": 0
}'

Delete menu item

DELETE /api/index.php/v1/menus/site/items/{id}
TypeDescription
componentLink to Joomla component
urlExternal or internal URL
aliasAlias to another menu item
separatorSeparator line
headingHeading (not clickable)

Article

index.php?option=com_content&view=article&id={article_id}

Category blog

index.php?option=com_content&view=category&layout=blog&id={category_id}

Category list

index.php?option=com_content&view=category&id={category_id}

Contact

index.php?option=com_contact&view=contact&id={contact_id}

All contacts

index.php?option=com_contact&view=categories

Filtering

By menu type

GET /api/index.php/v1/menus/site/items?filter[menutype]=mainmenu

By publication status

GET /api/index.php/v1/menus/site/items?filter[published]=1

By parent

GET /api/index.php/v1/menus/site/items?filter[parent_id]=1

Use parent_id to create submenus.

Example: Submenu item

curl -X POST "https://yoursite.com/api/index.php/v1/menus/site/items" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Sub Item",
"menutype": "mainmenu",
"type": "url",
"link": "/sub-page",
"parent_id": 101
}'