Skip to content

Platform

Storage and media

Files live in your workspace’s own storage, organised by folder. Post small files to /media. For large files, get a presigned URL, upload straight to storage, then confirm.

POST/v1/api/infra/storage/media

Upload files (multipart). Large images are compressed.

filefileRequired
Up to 50 files, 100 MB each.
folderstringOptional
Destination folder.

GET/v1/api/infra/storage/media

List media in a folder (?folder=).

DELETE/v1/api/infra/storage/media

Delete a file by ?key=.

POST/v1/api/infra/storage/files/upload-url

Get a presigned upload URL (plan feature).

folderstringRequired
Destination folder.
filenamestringRequired
File name with extension.
contentTypestringRequired
MIME type, e.g. application/pdf.

POST/v1/api/infra/storage/files/confirm-upload

Confirm a presigned upload; returns the file’s URL and type.

keystringRequired
The key returned with the upload URL.

POST/v1/api/infra/storage/files/download-url

Short-lived download URL for a file.

keystringRequired
The file’s key.

GET/v1/api/infra/storage/files/usage

Bytes used against your quota.

// Presign, upload straight to storage, and confirm in one call
const { data: file } = await ecod.infra.storage.media.upload(buffer, {
  folder: "invoices",
  filename: "INV-1001.pdf",
  contentType: "application/pdf",
});