Endpoint
multipart/form-data
Form fields
file[]
required
One or more files to upload. Each file is validated for type and size.Allowed types: JPEG, PNG, WebP, AVIF, GIF, HEIC/HEIF, PSD, MP4, MOV, WebM, WAV, MP3, OGG, GLB, glTFMax size per file: Configurable via
MAX_FILE_SIZE_MB (default: 50 MB)HEIC/HEIF files are transcoded to JPEG on upload. The returned
filename, path, and url will have a .jpg extension instead of the original .heic/.heif.string
Destination folder path within storage. Nested folders are supported.
photos · uploads/2024/januaryIf omitted, files are stored at the root.string[]
Custom filenames for each uploaded file, in the same order as
files. If omitted, the original filename is used.Must include the file extension.string[]
Transformation segments to prewarm (pre-generate and cache) immediately after upload. Supports up to 20 variants.
w_800,h_600,c_fill · w_400,f_webp,q_85Pre-warming ensures the first user request is served from cache without any processing delay.Response
200, All files uploaded successfully
207, Partial success (some files failed)
400, Validation error (invalid type, size exceeded, etc.)
A fully successful upload returns only success and files. There is no errors key, and the optional per-file arrays appear only when they have something in them:
boolean
true if at least one file was processed. On a 207 this is still true,
so check errors rather than success to detect partial failure.array
Successfully uploaded files.
array
Files that failed to upload. Present only on a
207 or a 400.Examples
- Single file
- Upload to folder
- Upload with prewarm
- Multiple files with custom names
Related
Create Folder
Create an empty folder in storage.
Upload & Cache Warming
Prewarm strategy guide.
Delete File
Remove a file and its cached variants.
Sign Upload
Let an untrusted client upload without your API key.