Skip to main content

Endpoint

Auth: API Key, session, or a presigned signature from Sign Upload Content-Type: multipart/form-data

Form fields

files
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, WebMMax 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.
folder
string
Destination folder path within storage. Nested folders are supported.photos · uploads/2024/januaryIf omitted, files are stored at the root.
names
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.
transformations
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.)
success
boolean
true if all files were processed without error.
files
array
Successfully uploaded files.
errors
array
Files that failed to upload.

Examples

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.