# Dashboard API ## Get Dashboard Sections Retrieve all dashboard sections for a specific library, including smart sections and user collections. **Endpoint**: `GET /api/dashboard/sections` **Authentication**: Required (Bearer token) ### Query Parameters | Parameter | Type | Required | Description | |-----------|--------|----------|-----------------------------------------------| | library_id| string | Yes | Library UUID to fetch sections for | | limit | number | No | Items per section (default: 20, max: 100) | ### Response Returns array of sections in user's customized order (respects `section_order` and `hidden_sections` preferences). **Section Types**: - `smart`: Auto-generated sections based on reading activity - `collection`: User-created collections with `show_on_dashboard: true` **Smart Sections**: | ID | Title | Icon | Description | |-----------------|------------------|------|--------------------------------------------------| | continue-reading| Continue Reading | 📖 | Books with progress > 0% and < 100% | | in-progress | In Progress | 📚 | Books with progress > 0% | | recently-added | Recently Added | 🆕 | Newest items in library | | recently-read | Recently Read | ✅ | Books with progress = 100% | | unread | Not Started | 📕 | Books with no reading progress | ### Example Response ```json { "sections": [ { "id": "continue-reading", "type": "smart", "title": "Continue Reading", "icon": "📖", "items": [ { "id": "uuid-here", "title": "Book Title", "author": "Author Name", "cover_image_path": "/path/to/cover.jpg" } ], "view_all_url": "/section/continue-reading" }, { "id": "collection-uuid", "type": "collection", "title": "My Favorites", "icon": "⭐", "items": [], "view_all_url": null } ] } ``` ### User Preferences The endpoint respects user's dashboard preferences: - **`section_order`**: Sections returned in user's custom order - **`hidden_sections`**: Hidden sections excluded from response - **`items_per_section`**: Default limit from user preferences (overridden by `?limit=` query param) ### Error Responses | Status | Description | |--------|------------------------| | 400 | Missing library_id | | 400 | Invalid library_id | | 401 | Unauthorized | | 500 | Failed to load sections |