Overview
REST Menu Items provides a REST endpoint to retrieve menu items by menu name.
Request for example https://example.com/api/menu_items/main?_format=json to get the full menu tree of the main menu as JSON.
This module is useful for decoupled and headless Drupal architectures where a JavaScript front end needs access to Drupal menu structures via a web service.
Features
- REST endpoint for any Drupal menu:
/api/menu_items/{menu_name} - Control output depth with
max_depthandmin_depthquery parameters - Configurable output values (title, URI, alias, UUID, weight, etc.)
- Restrict which menus are exposed via the configuration form
- Supports JSON, HAL+JSON, and XML formats
- Two alter hooks for customizing the output:
hook_rest_menu_items_resource_manipulators_alter— modify menu tree manipulatorshook_rest_menu_items_output_alter— modify the output array
Questions or feature requests?
If you have any questions or feature requests, please don't hesitate to add them to the issue queue.
🤖 Assisted Development
This module is maintained with the help of AI assistants for code generation, review, testing, and documentation. All code is carefully reviewed by the maintainers to ensure that quality and security standards are met.
Supporting organizations:
Sponsoring and support
Project information
- Project categories: Content editing experience, Decoupled, Developer tools
1,899 sites report using this module
- Created by fabianderijk on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.



