This endpoint requires authentication. Users can only access their own media files.
Overview
Retrieve all media files from the user’s Media Vault. This endpoint automatically syncs storage files with the database, backfilling any missing records.Query Parameters
string
default:"all"
Filter media by source category.Options:
all- Return all mediasmart-caption- Only Smart Captionsbabecock- Only Babecock Studio mediahypnococks- Only HypnoCocks mediaupload- Only user uploads
string
default:"all"
Filter media by creation date.Options:
all- All timetoday- Today onlyweek- Last 7 daysmonth- Current monthyear- Current year
string
Search media by filename, original name, caption, or character name. Case-insensitive partial matching.
Storage Synchronization
Automatic Backfill
This endpoint performs automatic synchronization between Supabase Storage and the database:- Fetch existing database records for the user
- List all files from the following storage folders:
Captions/(Smart Captions)Babecocks/(Babecock Studio)HypnoCocks/(HypnoCocks)Uploads/(General uploads)
- Backfill missing records: Any files found in storage but not in the database are automatically added
- Queue enrichment: Newly backfilled items are queued for metadata enrichment (dimensions, character detection, etc.)
Backfilled Media Fields
Response
array
required
Array of media file objects
number
required
Total number of files returned after filtering
object
required
Count of files in each categoryProperties:
smart-caption(number)babecock(number)hypnococks(number)upload(number)
File Object Schema
number
required
Database ID of the media item (for bulk operations)
string
required
Display name of the file (friendly name or filename)
string
required
Original filename when uploaded
string
required
Source category:
smart-caption, babecock, hypnococks, or uploadnumber
required
File size in bytes
string
required
ISO 8601 timestamp of when the file was created
string
required
ISO 8601 timestamp of creation (same as lastModified)
string
required
Public URL to access the file
string
required
Storage path:
users/{userId}/{Folder}/{filename}string
Source subreddit if the media was fetched from Reddit
number
Image/video width in pixels (if enriched)
number
Image/video height in pixels (if enriched)
Whether the media has a share link generated
Unique share code if the media is shared
string
Detected character or model name (if enriched)
string
Status of metadata enrichment:
pending, processing, completed, or failedstring
ISO 8601 timestamp of when enrichment was completed
Success Response Example
Error Responses
500 Internal Server Error
Example Usage
cURL
JavaScript (Fetch API)
React Example with Filtering
Notes
- Media is sorted by creation date in descending order (newest first)
- The endpoint performs automatic backfill on every request to keep database in sync with storage
- Metadata files (
.json) are automatically excluded from results - Only valid media files (jpg, jpeg, png, gif, webp, mp4, mov, webm) are included
- Enrichment is queued automatically for backfilled items but happens asynchronously