Media
The media library holds a project’s images, video, audio, and other files, served from public URLs. In the API these are the assets endpoints (client.assets in the SDK).
List assets
Section titled “List assets”GET /api/v1/projects/{id}/assetsQuery: path to list a sub-folder. Returns { assets } where each is { name, path, url, size, contentType, updated_at }.
await client.assets.list(projectId)Upload an asset
Section titled “Upload an asset”POST /api/v1/projects/{id}/assetsAccepts either multipart/form-data (a file field plus an optional path) or JSON (filename, base64, optional contentType). Returns the created asset with 201.
curl -X POST "https://www.frontend.co/api/v1/projects/$ID/assets" \ -H "Authorization: Bearer $FRONTEND_API_KEY" \ -F "file=@logo.png" -F "path=logo.png"await client.assets.upload(projectId, 'logo.png', blob, 'image/png')Direct uploads are limited to ~4.5 MB. For larger files, use a signed URL.
Signed upload URL
Section titled “Signed upload URL”POST /api/v1/projects/{id}/assets/upload-urlBody: filename. Returns { uploadUrl, token, path, publicUrl } — PUT the file bytes directly to uploadUrl.
const { uploadUrl, publicUrl } = await client.assets.createUploadUrl(projectId, 'video.mp4')await fetch(uploadUrl, { method: 'PUT', body: file, headers: { 'Content-Type': 'video/mp4' } })Delete an asset
Section titled “Delete an asset”DELETE /api/v1/projects/{id}/assets/{path}Returns { deleted }.
await client.assets.delete(projectId, 'logo.png')