Navigation Items API
Endpoints for managing navigation panel (menu) items in the system.
Get list of navigation items
Get the complete list of navigation items.
Request
GET /api/navbar-items
Headers
Name | Type | Description |
---|---|---|
X-API-Key | string | Required. API key |
Query parameters
Name | Type | Description |
---|---|---|
page | integer | Optional. Page number (default: 1) |
per_page | integer | Optional. Number of records per page (default: 20) |
Response
{
"navbar_items": [
{
"id": 1,
"title": "Home",
"url": "/",
"new_tab": false,
"icon": "home",
"position": 0,
"visible_only_for_guests": false,
"visible_only_for_logged_in": false,
"visibility": "all",
"parent_id": null
},
{
"id": 2,
"title": "About",
"url": "/about",
"new_tab": false,
"icon": "info",
"position": 1,
"visible_only_for_guests": false,
"visible_only_for_logged_in": false,
"visibility": "all",
"parent_id": null
}
]
}
Response fields
Field | Type | Description |
---|---|---|
navbar_items | array | Array of navigation items |
id | integer | Navigation item ID |
title | string | Item title |
url | string | Item URL (can be null) |
new_tab | boolean | Open in new tab |
icon | string | Item icon (can be null) |
position | integer | Item position in navigation |
visible_only_for_guests | boolean | Visibility only for guests |
visible_only_for_logged_in | boolean | Visibility only for authenticated users |
visibility | string | Visibility (all, desktop, mobile) |
parent_id | integer | Parent item ID (can be null) |
Response codes
Code | Description |
---|---|
200 | Successful request |
401 | Invalid or missing API key |
403 | Insufficient permissions for the request |
Get navigation item data
Get detailed information about a specific navigation item.
Request
GET /api/navbar-items/{id}
Path parameters
Name | Type | Description |
---|---|---|
id | integer | Navigation item ID |
Headers
Name | Type | Description |
---|---|---|
X-API-Key | string | Required. API key |
Response
{
"navbar_item": {
"id": 1,
"title": "Home",
"url": "/",
"new_tab": false,
"icon": "home",
"position": 0,
"visible_only_for_guests": false,
"visible_only_for_logged_in": false,
"visibility": "all",
"parent_id": null,
"roles": [
{
"id": 1,
"name": "admin"
},
{
"id": 2,
"name": "user"
}
],
"children": [
{
"id": 3,
"title": "Subpage",
"url": "/subpage",
"new_tab": false,
"icon": null,
"position": 0,
"visible_only_for_guests": false,
"visible_only_for_logged_in": false,
"visibility": "all",
"parent_id": 1
}
]
}
}
Response fields
Field | Type | Description |
---|---|---|
navbar_item | object | Navigation item object |
id | integer | Navigation item ID |
title | string | Item title |
url | string | Item URL (can be null) |
new_tab | boolean | Open in new tab |
icon | string | Item icon (can be null) |
position | integer | Item position in navigation |
visible_only_for_guests | boolean | Visibility only for guests |
visible_only_for_logged_in | boolean | Visibility only for authenticated users |
visibility | string | Visibility (all, desktop, mobile) |
parent_id | integer | Parent item ID (can be null) |
roles | array | Array of roles that have access to this item |
children | array | Array of child navigation items |
Response codes
Code | Description |
---|---|
200 | Successful request |
401 | Invalid or missing API key |
403 | Insufficient permissions for the request |
404 | Navigation item not found |
Create navigation item
Create a new navigation item in the system.
Request
POST /api/navbar-items
Headers
Name | Type | Description |
---|---|---|
X-API-Key | string | Required. API key |
Content-Type | string | Required. application/json |
Request body
{
"title": "New Item",
"url": "/new-page",
"new_tab": false,
"icon": "star",
"position": 5,
"visible_only_for_guests": false,
"visible_only_for_logged_in": false,
"visibility": "all",
"parent_id": null,
"roles": [1, 2]
}
Request body parameters
Name | Type | Description |
---|---|---|
title | string | Required. Item title |
url | string | Optional. Item URL |
new_tab | boolean | Optional. Open in new tab (default: false) |
icon | string | Optional. Item icon |
position | integer | Optional. Item position in navigation (default: 0) |
visible_only_for_guests | boolean | Optional. Visibility only for guests (default: false) |
visible_only_for_logged_in | boolean | Optional. Visibility only for authenticated users (default: false) |
visibility | string | Optional. Visibility (all, desktop, mobile) (default: all) |
parent_id | integer | Optional. Parent item ID |
roles | array | Optional. Array of role IDs that have access |
Response
{
"message": "Navigation item created successfully",
"navbar_item": {
"id": 3,
"title": "New Item",
"url": "/new-page",
"new_tab": false,
"icon": "star",
"position": 5,
"visible_only_for_guests": false,
"visible_only_for_logged_in": false,
"visibility": "all",
"parent_id": null
}
}
Response codes
Code | Description |
---|---|
201 | Navigation item created successfully |
401 | Invalid or missing API key |
403 | Insufficient permissions for the request |
422 | Invalid request parameters |
Update navigation item
Update an existing navigation item.
Request
PUT /api/navbar-items/{id}
Path parameters
Name | Type | Description |
---|---|---|
id | integer | Navigation item ID |
Headers
Name | Type | Description |
---|---|---|
X-API-Key | string | Required. API key |
Content-Type | string | Required. application/json |
Request body
{
"title": "Updated Item",
"url": "/updated-page",
"new_tab": true,
"icon": "edit",
"position": 3,
"visible_only_for_guests": false,
"visible_only_for_logged_in": true,
"visibility": "desktop",
"parent_id": 1,
"roles": [1]
}
Request body parameters
Name | Type | Description |
---|---|---|
title | string | Optional. Item title |
url | string | Optional. Item URL |
new_tab | boolean | Optional. Open in new tab |
icon | string | Optional. Item icon |
position | integer | Optional. Item position in navigation |
visible_only_for_guests | boolean | Optional. Visibility only for guests |
visible_only_for_logged_in | boolean | Optional. Visibility only for authenticated users |
visibility | string | Optional. Visibility (all, desktop, mobile) |
parent_id | integer | Optional. Parent item ID |
roles | array | Optional. Array of role IDs that have access |
Response
{
"message": "Navigation item updated successfully",
"navbar_item": {
"id": 3,
"title": "Updated Item",
"url": "/updated-page",
"new_tab": true,
"icon": "edit",
"position": 3,
"visible_only_for_guests": false,
"visible_only_for_logged_in": true,
"visibility": "desktop",
"parent_id": 1
}
}
Response codes
Code | Description |
---|---|
200 | Navigation item updated successfully |
401 | Invalid or missing API key |
403 | Insufficient permissions for the request |
404 | Navigation item not found |
422 | Invalid request parameters |
Delete navigation item
Delete a navigation item from the system.
Request
DELETE /api/navbar-items/{id}
Path parameters
Name | Type | Description |
---|---|---|
id | integer | Navigation item ID |
Headers
Name | Type | Description |
---|---|---|
X-API-Key | string | Required. API key |
Response
{
"message": "Navigation item deleted successfully"
}
Response codes
Code | Description |
---|---|
200 | Navigation item deleted successfully |
401 | Invalid or missing API key |
403 | Insufficient permissions for the request |
404 | Navigation item not found |
422 | Cannot delete, there are child items |
Reorder navigation items
Change the order of navigation items.
Request
POST /api/navbar-items/reorder
Headers
Name | Type | Description |
---|---|---|
X-API-Key | string | Required. API key |
Content-Type | string | Required. application/json |
Request body
{
"items": [
{
"id": 1,
"position": 0
},
{
"id": 2,
"position": 1
},
{
"id": 3,
"position": 2
}
]
}
Request body parameters
Name | Type | Description |
---|---|---|
items | array | Required. Array of items with new positions |
id | integer | Navigation item ID |
position | integer | New position for the item |
Response
{
"message": "Navigation items reordered successfully"
}
Response codes
Code | Description |
---|---|
200 | Navigation items reordered successfully |
401 | Invalid or missing API key |
403 | Insufficient permissions for the request |
422 | Invalid request parameters |
Get navigation item roles
Get roles assigned to a specific navigation item.
Request
GET /api/navbar-items/{id}/roles
Path parameters
Name | Type | Description |
---|---|---|
id | integer | Navigation item ID |
Headers
Name | Type | Description |
---|---|---|
X-API-Key | string | Required. API key |
Response
{
"roles": [
{
"id": 1,
"name": "admin",
"color": "#ff0000"
},
{
"id": 2,
"name": "user",
"color": "#00ff00"
}
]
}
Response fields
Field | Type | Description |
---|---|---|
roles | array | Array of roles |
id | integer | Role ID |
name | string | Role name |
color | string | Role color |
Response codes
Code | Description |
---|---|
200 | Successful request |
401 | Invalid or missing API key |
403 | Insufficient permissions for the request |
404 | Navigation item not found |
Assign roles to navigation item
Assign roles to a navigation item.
Request
POST /api/navbar-items/{id}/roles
Path parameters
Name | Type | Description |
---|---|---|
id | integer | Navigation item ID |
Headers
Name | Type | Description |
---|---|---|
X-API-Key | string | Required. API key |
Content-Type | string | Required. application/json |
Request body
{
"roles": [1, 2, 3]
}
Request body parameters
Name | Type | Description |
---|---|---|
roles | array | Required. Array of role IDs |
Response
{
"message": "Roles assigned to navigation item successfully"
}
Response codes
Code | Description |
---|---|
200 | Roles assigned successfully |
401 | Invalid or missing API key |
403 | Insufficient permissions for the request |
404 | Navigation item not found |
422 | Invalid request parameters |
Remove roles from navigation item
Remove roles from a navigation item.
Request
DELETE /api/navbar-items/{id}/roles
Path parameters
Name | Type | Description |
---|---|---|
id | integer | Navigation item ID |
Headers
Name | Type | Description |
---|---|---|
X-API-Key | string | Required. API key |
Content-Type | string | Required. application/json |
Request body
{
"roles": [1, 2]
}
Request body parameters
Name | Type | Description |
---|---|---|
roles | array | Required. Array of role IDs |
Response
{
"message": "Roles removed from navigation item successfully"
}
Response codes
Code | Description |
---|---|
200 | Roles removed successfully |
401 | Invalid or missing API key |
403 | Insufficient permissions for the request |
404 | Navigation item not found |
422 | Invalid request parameters |