Create Saved Search
POST /api/writing/search/saved
πΎ Create a new saved search
Saves a search query with its filters and parameters for future reuse. Enables quick access to frequently used search patterns and complex queries without rebuilding them manually.
Request Body:
request: SavedSearch object with search query and filters
Dependencies:
writing_service: Injected IshvanaWritingModule instance
Returns:
- Created SavedSearch object with generated ID
Raises:
HTTPException 500: If saved search creation fails
Example Response:
{
"search_id": "search_123",
"name": "Recent Character Notes",
"query": "character development",
"filters": {"document_type": "notes"},
"created_at": "2024-12-19T10:30:00Z"
}Request Body required
Section titled βRequest Body required β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
object
object
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
object
object
Validation Error