Skip to main content
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 media
  • smart-caption - Only Smart Captions
  • babecock - Only Babecock Studio media
  • hypnococks - Only HypnoCocks media
  • upload - Only user uploads
string
default:"all"
Filter media by creation date.Options:
  • all - All time
  • today - Today only
  • week - Last 7 days
  • month - Current month
  • year - Current year
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:
  1. Fetch existing database records for the user
  2. List all files from the following storage folders:
    • Captions/ (Smart Captions)
    • Babecocks/ (Babecock Studio)
    • HypnoCocks/ (HypnoCocks)
    • Uploads/ (General uploads)
  3. Backfill missing records: Any files found in storage but not in the database are automatically added
  4. 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 upload
number
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)
boolean
required
Whether the media has a share link generated
string
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 failed
string
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