Skip to content

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"
    }
]

Successful Response

Response Get Saved Searches Api Writing Search Saved Get
Array<object>
SavedSearch

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
searchId
required
Searchid
string
projectId
Projectid
string
""
name
required
Name
string
query
required
Query
string
filters
Filters
object
key
additional properties
any
description
Description
string
""
useCount
Usecount
integer
0
lastUsed
Lastused
integer
0
createdAt
required
Createdat
integer
modifiedAt
required
Modifiedat
integer