Storage
Frontend Cloud storage is a per-project media store for images, audio, video, PDFs, and any other files your app uploads or serves. Files are managed through the /api/media endpoints and served publicly through /files.
Storage is available once Frontend Cloud is enabled on your project.
Endpoints
Section titled “Endpoints”| Method | Path | Description |
|---|---|---|
POST | /api/media | Upload a file (multipart form-data) |
GET | /api/media | List files (optional search and pagination) |
GET | /api/media/{id} | Download / stream a single file |
DELETE | /api/media/{id} | Delete a file |
GET | /files/{projectId}/media/{id} | Public, read-only URL for a file |
All /api/media requests are authenticated with your project API key. The /files route is public and requires no key — it’s the URL you embed in your deployed site.
Upload a file
Section titled “Upload a file”Send a multipart/form-data request with the file in a file field:
curl -X POST "https://cloud.frontend.co/api/media" \ -H "x-api-key: YOUR_API_KEY" \ -F "file=@./product.png"The response is a MediaItem:
{ "id": "5f3c1a9e-...-product.png", "url": "https://cloud.frontend.co/files/YOUR_PROJECT_ID/media/5f3c1a9e-...-product.png", "name": "product.png", "mimeType": "image/png"}Use the returned url to display the file anywhere — it resolves through the public /files route, so it works directly in <img> tags and links on your deployed site.
List files
Section titled “List files”curl "https://cloud.frontend.co/api/media?query=product" \ -H "x-api-key: YOUR_API_KEY"Returns a MediaPage:
{ "items": [ { "id": "...", "url": "...", "name": "product.png", "mimeType": "image/png" } ], "nextCursor": "eyJ..."}query(optional) filters items whose name contains the term.cursor(optional) fetches the next page — pass back thenextCursorfrom the previous response. WhennextCursoris absent, you’ve reached the last page.
Download a file
Section titled “Download a file”curl "https://cloud.frontend.co/api/media/5f3c1a9e-...-product.png" \ -H "x-api-key: YOUR_API_KEY" \ --output product.pngThis streams the raw file with its stored content type. For public, unauthenticated access from a browser or a deployed page, use the file’s url (the /files route) instead.
Delete a file
Section titled “Delete a file”curl -X DELETE "https://cloud.frontend.co/api/media/5f3c1a9e-...-product.png" \ -H "x-api-key: YOUR_API_KEY"{ "success": true, "id": "5f3c1a9e-...-product.png" }Uploading from your app
Section titled “Uploading from your app”async function upload(file: File) { const form = new FormData(); form.append('file', file);
const res = await fetch('https://cloud.frontend.co/api/media', { method: 'POST', headers: { 'x-api-key': process.env.FRONTEND_API_KEY! }, body: form, });
const item = await res.json(); return item.url as string; // public URL, ready to embed}