Media Service API
Catalog: /apis/media-api
Governs secure multimedia file uploads. Integrates direct S3 raw bucket transfers, AWS Lambda event triggers for AVIF/WebP image rendering across 6 size variants, HLS video transcoders, and Origin Access Control signed CloudFront serving.
Endpoints Reference
Complete list of GraphQL mutations, queries, gRPC procedures, and HTTP routes for this module.
POST /api/v1/media/upload
Accepts multipart/form-data upload. Internally streams bytes directly to S3 Raw bucket, performs file size checks, and catalogs asset metadata.
[Multipart Form Payload containing "file" binary, "scope" string, and "is_private" boolean]
{
"id": "c71fa793-1386-4554-b52b-b9d9c228807d",
"owner_id": "8c25345a-c5c9-4b62-97b7-6bbce3725458",
"original_name": "headset.png",
"mime_type": "image/png",
"status": "processing",
"is_private": false,
"created_at": "2026-06-05T18:00:00Z"
}
GET /api/v1/media
Returns a paginated list of media files uploaded by the authenticated user session, with all generated AVIF/WebP responsive URL paths.
GET /api/v1/media?limit=1&scope=product-image HTTP/1.1
{
"assets": [
{
"id": "c71fa793-1386-4554-b52b-b9d9c228807d",
"original_name": "headset.png",
"status": "completed",
"variants": {
"image": {
"thumbnail_small_avif": "https://cdn.wemall.com/images/c71f/thumbnail_small.avif",
"thumbnail_large_avif": "https://cdn.wemall.com/images/c71f/thumbnail_large.avif",
"main_desktop_avif": "https://cdn.wemall.com/images/c71f/main_desktop.avif",
"main_desktop_webp": "https://cdn.wemall.com/images/c71f/main_desktop.webp"
}
}
}
],
"total_count": 1
}
Database Tables & Data Models
Relational database schemas and custom payload models governing this service domain.
📂 media_assets (PostgreSQL)
Contains asset metadata, ownership scopes, processing states, and variation URL paths maps.
| Field Name | Data Type | Description / Constraint |
|---|---|---|
| id | UUID (Primary Key) | Unique asset identifier. |
| owner_id | UUID | Uploader user identifier. |
| service_scope | VARCHAR(50) | Domain context: 'user-avatar' | 'product-image' | 'seller-kyc'. |
| status | VARCHAR(30) | Processing state: 'pending_upload' | 'uploaded' | 'processing' | 'completed' | 'failed'. |
| variants | JSONB | Maps containing generated CDN URLs for WebP/AVIF images or HLS manifests. |
| is_private | BOOLEAN | Determines if files require CloudFront private signatures for access. |