curl --request POST \
--url https://api.dreep.cloud/api/v1/upload \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: multipart/form-data' \
--form file='@/path/to/image.jpg' \
--form width=800 \
--form format=webp{
"id": "med_123456789",
"url": "https://cdn.dreep.cloud/med_123456789/hero.jpg",
"originalFilename": "hero.jpg",
"mimetype": "image/webp",
"format": "webp",
"sizeBytes": 245000,
"width": 1200,
"height": 123,
"status": "ready",
"folderId": "<string>",
"projectId": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": true,
"message": "Invalid request parameters",
"code": "invalid_request"
}{
"error": true,
"message": "Invalid request parameters",
"code": "invalid_request"
}{
"error": true,
"message": "Invalid request parameters",
"code": "invalid_request"
}{
"error": true,
"message": "Invalid request parameters",
"code": "invalid_request"
}Upload Media
Upload images, videos, or raw files in a single multipart request, with optional transformations.
curl --request POST \
--url https://api.dreep.cloud/api/v1/upload \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: multipart/form-data' \
--form file='@/path/to/image.jpg' \
--form width=800 \
--form format=webp{
"id": "med_123456789",
"url": "https://cdn.dreep.cloud/med_123456789/hero.jpg",
"originalFilename": "hero.jpg",
"mimetype": "image/webp",
"format": "webp",
"sizeBytes": 245000,
"width": 1200,
"height": 123,
"status": "ready",
"folderId": "<string>",
"projectId": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": true,
"message": "Invalid request parameters",
"code": "invalid_request"
}{
"error": true,
"message": "Invalid request parameters",
"code": "invalid_request"
}{
"error": true,
"message": "Invalid request parameters",
"code": "invalid_request"
}{
"error": true,
"message": "Invalid request parameters",
"code": "invalid_request"
}Choosing a destination
Name the destination folder withfolder (a path), key (a full S3-style
object key), or folderId (a UUID). Only one may be given per request. Missing
folders in a path are created automatically, at any depth.
curl -X POST https://api.dreep.cloud/api/v1/upload \
-H "Authorization: Bearer drp_live_xxxxx" \
-F "[email protected]" \
-F "folder=avatars/2024/q1"
Marketing Assets and marketing-assets
resolve to the same folder. Full details in
Folders & Paths.
Images
Apply resizing, cropping, format conversion, and compression before storing. Supported inputs: JPEG (.jpg, .jpeg), PNG (.png), WebP (.webp), GIF (.gif), TIFF (.tif, .tiff), BMP (.bmp).
Applicable parameters: format, width, height, fit, quality.
jpeg, png, webp, avif, tiff, gif. Requesting video output formats on an image upload is blocked.Videos
Apply trimming, frame-rate adjustment, and container re-encoding. Supported inputs: MP4 (.mp4), MOV (.mov), WebM (.webm).
Applicable parameters: format, width, height, fit, quality, fps.
mp4, webm, mov, hls (.m3u8), gif (animated clip). Requesting static image target formats (e.g. jpeg or webp) on a video upload is blocked.Raw Files
Store non-transformable files directly, up to 500MB.- Documents: PDF (
.pdf), Word (.doc,.docx), Excel (.xls,.xlsx), PowerPoint (.ppt,.pptx) - Text & Data: CSV (
.csv), TXT (.txt), JSON (.json) - Archives: ZIP (
.zip)
format, width, height, quality, fps) with a raw file is not allowed and will be ignored or rejected.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The media file to upload.
Slug path of the destination folder, relative to the project root. Missing folders are created automatically, at any depth. Segments are normalized to slugs, so Marketing Assets/2024 and marketing-assets/2024 are the same folder. Max 10 levels deep.
"avatars/2024/q1"
Full S3-style object key. Everything before the last / is the folder path (created if missing); the last segment becomes the stored filename. Mutually exclusive with folder.
"avatars/2024/q1/me.webp"
UUID of an existing folder to upload into. Mutually exclusive with folder and with a key that carries a folder prefix. Omitting all three uploads into the project's default folder.
"78b52933-5541-4e90-8c15-39a84a412da8"
Set to false to require that the folder path already exists. An unknown path then returns 404 instead of creating the folders.
true, false [Image/Video] Re-encode the file to this format before storing.
jpeg, png, webp, avif, gif, tiff, mp4, webm, mov, hls, m3u8 [Image/Video] Resize to this width in pixels.
[Image/Video] Resize to this height in pixels.
[Image/Video] How the media should fit width/height.
cover, contain, fill, inside, outside [Image] Explicitly crop the image using left, top, width, and height coordinates.
Show child attributes
Show child attributes
[Image/Video] Output quality (1-100).
[Video Only] Output frame rate for video files (e.g. 24, 30, 60).
[Video Only] Video encoding codec.
libx264, libvpx-vp9, h264, hevc [Video Only] Trim start timestamp in seconds.
[Video Only] Trim end timestamp in seconds.
[Image Only] Crop anchor point when resizing images.
north, northeast, east, southeast, south, southwest, west, northwest, center, attention, entropy [Image Only] Device pixel ratio multiplier (max 3).
[Image Only] Rotate by this many degrees clockwise.
90, 180, 270 [Image Only] Hex color (without #) used to pad/fill, e.g. ffffff.
[Image Only] Corner radius in pixels, or max for a full circle/pill.
[Image/Video] A saved transform preset key to apply instead of individual fields.
Response
Media uploaded successfully
"med_123456789"
"https://cdn.dreep.cloud/med_123456789/hero.jpg"
"hero.jpg"
"image/webp"
Only present for images.
"webp"
245000
Only present for images.
1200
Only present for images.
"ready"