1 OAK MLS
Guides

Media Library

Upload, organize, and manage workspace media assets

Media Library

The media library provides centralized management of all workspace images — hero backgrounds, blog post images, branding assets, and listing photos.

Overview

Media assets are stored in the workspace_media table with files in Supabase Storage. Each asset belongs to a workspace and can optionally be linked to a listing.

Accessing the Media Library

  1. Go to Dashboard → Media
  2. Browse, search, and filter your uploaded assets
  3. Upload new files via drag-and-drop or the upload button

Upload Specifications

SettingValue
Accepted formatsJPEG, PNG, WebP, HEIC
Maximum file size20 MB per file
StorageSupabase Storage (workspace-media bucket)

Media Categories

Organize uploads by intended use:

CategoryDescriptionTypical Usage
heroHero section backgroundsHomepage, page heroes
listingListing-related photosSupplemental listing images
blogBlog post imagesFeatured images, inline photos
brandingBrand assetsLogos, headshots, team photos
generalUncategorizedAny other workspace images

Categories can be set during upload or changed later.

Using the MediaPicker

The MediaPicker component appears throughout the dashboard wherever an image can be selected (hero settings, blog posts, branding). It provides:

  • Browse — Grid of existing media assets with category filtering
  • Upload — Drag-and-drop or click to upload new files
  • Search — Filter by filename or address
  • Select — Click to select an asset and insert its URL

When uploading media, you can associate it with a property address. This makes it easy to find listing-related photos later. The media library supports searching by address text.

Listing Association

Media assets can be linked to specific listings via the listing_id field. This enables:

  • Finding all custom photos for a listing
  • Deletion safety — The system warns before deleting media that is currently in use by a listing's hero image, blog post, or landing page
  • Organizing photos by property

Storage Tracking

Monitor your workspace's storage usage:

  • API: GET /api/dashboard/media/storage
  • Returns total bytes used and file count
  • Displayed in the media library header

API Endpoints

EndpointMethodDescription
/api/dashboard/mediaGETList media assets (with category filter, pagination)
/api/dashboard/mediaPOSTUpload a new media asset (FormData)
/api/dashboard/media/[id]DELETEDelete a media asset
/api/dashboard/media/storageGETGet storage usage stats

POST /api/dashboard/media

Upload via multipart/form-data:

FieldTypeRequiredDescription
fileFileYesThe image file (max 20 MB)
categoryStringNoOne of: hero, listing, blog, branding, general
listing_idUUIDNoAssociate with a listing
addressStringNoProperty address for search

GET /api/dashboard/media

ParameterTypeDescription
categoryStringFilter by category
listing_idUUIDFilter by listing
searchStringSearch filename or address
pageNumberPage number (default: 1)
per_pageNumberItems per page (default: 24)

On this page