MinMaxHub
Documentation
  • Introduction
  • Architecture
  • Frontend
Domains
  • Nodes
  • Entities
  • Consensus
  • Suggestions
Resources
  • API Reference

Copyright 2026 MinMaxHub

  • Documentation
  • Domains
  • API Reference
NodesEntitiesSuggestionsVotesConsensusUsersRulesMedia
powered by Zudoku
Domains

Media

The Media domain handles image uploads and optimization for MinMaxHub. Users upload images via presigned URLs, and an asynchronous pipeline converts them to optimized WebP format.

How Uploads Work

Uploading an image is a two-step process:

1. Get a Presigned URL

Call the presign endpoint with the desired file key and content type. The API returns:

  • uploadUrl -- a temporary signed URL for uploading the file directly to storage.
  • mediaUrl -- the permanent public URL where the image will be accessible.

2. Upload the File

PUT the image file directly to the uploadUrl. After upload, an asynchronous optimization pipeline converts the image to WebP format (capped at 2000px on the longest side). The mediaUrl remains the same -- once optimization completes, it serves the optimized version.

Supported Contexts

Images can be uploaded for three contexts:

ContextKey PatternExample
User avatarsusers/{userId}/avatar.webpProfile pictures
Entity hero imagesentities/{entityId}/hero.webpPage cover images
Node cover imagesnodes/{nodeId}/cover.webpCategory images

All upload keys must end in .webp.

Accepted File Types

  • image/jpeg
  • image/png
  • image/webp

Maximum file size: 5 MB (enforced client-side).

Presign Request

Code
{ "key": "users/abc-123/avatar.webp", "contentType": "image/jpeg" }

Presign Response

Code
{ "uploadUrl": "https://...(temporary signed URL)...", "mediaUrl": "https://...(permanent public URL)..." }

The presigned upload URL expires after 15 minutes.

API Endpoints

MethodEndpointPurposeAuth
POST/media/presignGet a presigned upload URLRequired
Last modified on April 2, 2026
Rules
On this page
  • How Uploads Work
    • 1. Get a Presigned URL
    • 2. Upload the File
  • Supported Contexts
  • Accepted File Types
  • Presign Request
  • Presign Response
  • API Endpoints
JSON
JSON