Get Saved Searches
GET /api/writing/search/saved
📋 Get all saved searches
Retrieves all saved search queries for quick access to frequently used search patterns. Returns complete search configurations with filters and metadata for immediate reuse.
Dependencies:
writing_service: Injected IshvanaWritingModule instance
Returns:
- List of SavedSearch objects with full search configurations
Raises:
HTTPException 500: If retrieval operation fails
Example Response:
[
{
"search_id": "search_123",
"name": "Character Notes",
"query": "character development",
"filters": {"document_type": "notes"},
"created_at": "2024-12-19T10:30:00Z"
}
]Responses
Section titled “ Responses ”Successful Response
Saved search query model.
Represents a saved search query with filters for quick re-execution.
Enables users to save frequently used searches and share search patterns.
Mirrors every column on the saved_searches SQLite table so
WritingSearchService can round-trip rows through model_validate
without dropping fields.
Fields:
search_id: Unique saved search identifier (renamed from id)
project_id: Owning project ID (empty string for global searches)
name: Human-readable search name
query: Search query string
filters: Optional saved filters (free-form dict)
description: Free-text description
use_count: How many times this search has been executed
last_used: Unix timestamp (ms) of the most recent execution
created_at: Unix timestamp (ms) when the search was saved
modified_at: Unix timestamp (ms) of the most recent edit
Used By: - SavedSearchResponse for single-search retrieval - SavedSearchListResponse for the saved-search index - Quick search execution