Search Presets API
Endpoints for saving and managing gallery search filter presets.
Overview
The Search Presets API enables saving frequently-used search filter combinations for quick access in the Gallery. Instead of manually configuring filters each time, save them as named presets.
List Search Presets
Retrieve all saved search presets for the tenant.
http
GET /api/search-presetsRequest
bash
curl -X GET "https://gobananasai.com/api/search-presets" \
-H "X-API-Key: sk_live_xxx"Response
json
{
"data": [
{
"id": 1,
"tenantId": "acme-corp",
"presetName": "Recent Edits",
"filters": {
"operationType": "edit",
"sortBy": "newest"
},
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
},
{
"id": 2,
"tenantId": "acme-corp",
"presetName": "Large Generated Images",
"filters": {
"operationType": "generate",
"minSize": 1000000,
"sortBy": "largest"
},
"createdAt": "2024-01-14T08:15:00.000Z",
"updatedAt": "2024-01-14T08:15:00.000Z"
},
{
"id": 3,
"tenantId": "acme-corp",
"presetName": "This Week",
"filters": {
"dateFrom": "2024-01-15",
"dateTo": "2024-01-22",
"sortBy": "newest"
},
"createdAt": "2024-01-10T12:00:00.000Z",
"updatedAt": "2024-01-10T12:00:00.000Z"
}
]
}Create Search Preset
Save a new search filter preset.
http
POST /api/search-presetsRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
presetName | string | Yes | Unique preset name (1-50 chars) |
filters | object | Yes | Filter configuration object |
Filter Options
| Filter | Type | Description |
|---|---|---|
search | string | Text search in prompts |
searchMode | string | exact, all, or any |
dateFrom | string | Start date (ISO format) |
dateTo | string | End date (ISO format) |
aspectRatio | string | Filter by aspect ratio |
operationType | string | generate or edit |
minSize | number | Minimum file size in bytes |
maxSize | number | Maximum file size in bytes |
sessionId | string | Filter by session |
hasNegativePrompt | boolean | Filter by negative prompt presence |
sortBy | string | newest, oldest, largest, smallest |
Request
bash
curl -X POST "https://gobananasai.com/api/search-presets" \
-H "X-API-Key: sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"presetName": "Product Shots This Month",
"filters": {
"search": "product",
"searchMode": "any",
"dateFrom": "2024-01-01",
"operationType": "generate",
"aspectRatio": "square",
"sortBy": "newest"
}
}'Response
json
{
"data": {
"id": 4,
"tenantId": "acme-corp",
"presetName": "Product Shots This Month",
"filters": {
"search": "product",
"searchMode": "any",
"dateFrom": "2024-01-01",
"operationType": "generate",
"aspectRatio": "square",
"sortBy": "newest"
},
"createdAt": "2024-01-20T15:00:00.000Z",
"updatedAt": "2024-01-20T15:00:00.000Z"
}
}Delete Search Preset
Remove a search preset.
http
DELETE /api/search-presets/:idRequest
bash
curl -X DELETE "https://gobananasai.com/api/search-presets/4" \
-H "X-API-Key: sk_live_xxx"Response
json
{
"data": {
"deleted": true
}
}Error Responses
400 Missing Preset Name
json
{
"error": "presetName is required and must be a string"
}400 Empty Preset Name
json
{
"error": "presetName cannot be empty"
}400 Name Too Long
json
{
"error": "presetName cannot exceed 50 characters"
}400 Missing Filters
json
{
"error": "filters is required and must be an object"
}400 Duplicate Name
json
{
"error": "Preset with name \"Recent Edits\" already exists"
}400 Invalid ID
json
{
"error": "Invalid preset ID"
}404 Preset Not Found
json
{
"error": "Preset not found"
}Usage in Console
Search presets appear in the Gallery's filter panel under "Saved Searches". Click a preset to instantly apply its filters.
Gallery Filter Panel
┌──────────────────────────────────────┐
│ Saved Searches ▼ │
├──────────────────────────────────────┤
│ ⭐ Recent Edits │
│ ⭐ Large Generated Images │
│ ⭐ This Week │
│ ⭐ Product Shots This Month │
│ │
│ [+ Save Current Filters] │
└──────────────────────────────────────┘Filter Examples
Find All Landscape Edits
json
{
"presetName": "Landscape Edits",
"filters": {
"aspectRatio": "landscape",
"operationType": "edit",
"sortBy": "newest"
}
}Large Files for Review
json
{
"presetName": "Large Files (>5MB)",
"filters": {
"minSize": 5242880,
"sortBy": "largest"
}
}Session-Specific Search
json
{
"presetName": "Marketing Campaign Session",
"filters": {
"sessionId": "mcp-session-abc123",
"sortBy": "newest"
}
}Keyword Search with Mode
json
{
"presetName": "Character Images",
"filters": {
"search": "Luna hero protagonist",
"searchMode": "any",
"sortBy": "newest"
}
}