Navigation State Repository
API Contract
REST
/api/v1/navigation-states
9 endpoints
GET
/api/v1/navigation-states/api/v1/navigation-states
List all persisted navigation state records
Public
Response Example
{
"data": [
{
"id": "ns-001",
"state_type": "active_tab",
"tab_index": 2,
"route_stack": null,
"saved_at": "2026-03-25T16:00:00Z"
},
{
"id": "ns-002",
"state_type": "route_stack",
"tab_index": 1,
"route_stack": [
"HomeScreen",
"SearchScreen",
"ResultDetailScreen"
],
"saved_at": "2026-03-25T16:05:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 2
}
}
GET
/api/v1/navigation-states/api/v1/navigation-states/:id
Get a specific navigation state record
Public
Response Example
{
"id": "ns-002",
"state_type": "route_stack",
"tab_index": 1,
"route_stack": [
"HomeScreen",
"SearchScreen",
"ResultDetailScreen"
],
"saved_at": "2026-03-25T16:05:00Z"
}
POST
/api/v1/navigation-states/api/v1/navigation-states
Save a new navigation state (saveActiveTab or saveTabRouteStack)
Public
Request Example
{
"state_type": "route_stack",
"tab_index": 0,
"route_stack": [
"HomeScreen",
"NotificationsScreen"
]
}
Response Example
{
"id": "ns-003",
"state_type": "route_stack",
"tab_index": 0,
"route_stack": [
"HomeScreen",
"NotificationsScreen"
],
"saved_at": "2026-03-26T09:00:00Z"
}
PUT
/api/v1/navigation-states/api/v1/navigation-states/:id
Update a persisted navigation state record
Public
Request Example
{
"route_stack": [
"HomeScreen",
"NotificationsScreen",
"NotificationDetailScreen"
]
}
Response Example
{
"id": "ns-003",
"state_type": "route_stack",
"tab_index": 0,
"route_stack": [
"HomeScreen",
"NotificationsScreen",
"NotificationDetailScreen"
],
"saved_at": "2026-03-26T09:00:00Z",
"updated_at": "2026-03-26T09:20:00Z"
}
DELETE
/api/v1/navigation-states/api/v1/navigation-states/:id
Delete a navigation state record
Public
Response Example
{
"deleted": true,
"id": "ns-003"
}
GET
/api/v1/navigation-states/api/v1/navigation-states/active-tab
Load the persisted active tab index (loadActiveTab)
Public
Response Example
{
"tab_index": 2,
"saved_at": "2026-03-25T16:00:00Z"
}
PUT
/api/v1/navigation-states/api/v1/navigation-states/active-tab
Persist the currently active tab index (saveActiveTab)
Public
Request Example
{
"tab_index": 3
}
Response Example
{
"tab_index": 3,
"saved_at": "2026-03-26T09:25:00Z"
}
GET
/api/v1/navigation-states/api/v1/navigation-states/:tabIndex/route-stack
Load the persisted route stack for a given tab (loadTabRouteStack)
Public
Response Example
{
"tab_index": 1,
"route_stack": [
"HomeScreen",
"SearchScreen",
"ResultDetailScreen"
],
"saved_at": "2026-03-25T16:05:00Z"
}
PUT
/api/v1/navigation-states/api/v1/navigation-states/:tabIndex/route-stack
Persist the route stack for a given tab (saveTabRouteStack)
Public
Request Example
{
"route_stack": [
"HomeScreen",
"SearchScreen",
"ResultDetailScreen",
"MapScreen"
]
}
Response Example
{
"tab_index": 1,
"route_stack": [
"HomeScreen",
"SearchScreen",
"ResultDetailScreen",
"MapScreen"
],
"saved_at": "2026-03-26T09:30:00Z"
}