Skip to main content

Navigation

Navigation is organized into menus (e.g., primary, footer, sidebar) and items within those menus. Items support hierarchical nesting (parent/child) and per-locale titles.

Endpoints

MethodPathPermissionDescription
GET/sites/{site_id}/menusReadList all menus for a site
POST/sites/{site_id}/menusAuthorCreate a navigation menu
GET/menus/{id}ReadGet a menu by ID
GET/sites/{site_id}/menus/slug/{slug}ReadGet a menu by slug
PUT/menus/{id}AuthorUpdate a menu
DELETE/menus/{id}EditorDelete a menu (cascades to items)
GET/menus/{menu_id}/tree?localeReadGet the full navigation tree

Items

MethodPathPermissionDescription
GET/sites/{site_id}/navigationReadList root navigation items (primary menu)
GET/menus/{menu_id}/itemsReadList all items for a menu
GET/navigation/{id}ReadGet a navigation item by ID
GET/navigation/{parent_id}/childrenReadGet children of an item
POST/sites/{site_id}/navigationAuthorCreate an item (site-scoped)
POST/menus/{menu_id}/itemsAuthorCreate an item in a menu
PUT/navigation/{id}AuthorUpdate an item
DELETE/navigation/{id}EditorDelete an item
POST/sites/{site_id}/navigation/reorderAuthorBatch-reorder items (flat)
POST/menus/{menu_id}/items/reorderAuthorBatch-reorder items (with hierarchy)

Item Localizations

MethodPathPermissionDescription
GET/navigation/{id}/localizationsReadGet localizations for an item
PUT/navigation/{id}/localizationsAuthorUpsert localizations for an item

The tree endpoint returns the full hierarchical structure for a menu, with localized titles. Pass an optional locale query parameter to get titles in a specific language.

curl -H "X-API-Key: oy_live_abc123..." \
"https://your-domain.com/api/v1/menus/{menu_id}/tree?locale=en"

Response 200 OK

[
{
"id": "item-uuid",
"title": "Home",
"link_type": "internal",
"url": "/",
"display_order": 0,
"children": [
{
"id": "child-uuid",
"title": "About",
"link_type": "internal",
"url": "/about",
"display_order": 0,
"children": []
}
]
}
]

Reorder Items

The menu-level reorder endpoint supports updating both position and parent in a single call, enabling drag-and-drop rearrangement:

curl -X POST \
-H "X-API-Key: oy_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"items": [
{"id": "item-1", "parent_id": null, "display_order": 0},
{"id": "item-2", "parent_id": "item-1", "display_order": 0},
{"id": "item-3", "parent_id": null, "display_order": 1}
]
}' \
https://your-domain.com/api/v1/menus/{menu_id}/items/reorder

Response 204 No Content