Skip to main content
POST
The upload endpoint accepts images, videos, and raw files through one multipart request. Dreep detects the file type and applies the relevant processing — transforming images and videos on the fly, or storing raw files as-is. Optional transformation parameters are ignored or rejected when they don’t apply to the uploaded file type.

Choosing a destination

Name the destination folder with folder (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.
Upload into a nested path
Omit all three and the file lands in your project’s default folder. Path segments are normalized to slugs, so 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.
Allowed target formats: 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.
Allowed target formats: 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)
Raw files are stored and served exactly as uploaded. Passing transformation parameters (format, width, height, quality, fps) with a raw file is not allowed and will be ignored or rejected.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
file
file
required

The media file to upload.

folder
string

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.

Example:

"avatars/2024/q1"

key
string

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.

Example:

"avatars/2024/q1/me.webp"

folderId
string<uuid>

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.

Example:

"78b52933-5541-4e90-8c15-39a84a412da8"

autoCreateFolders
enum<string>
default:true

Set to false to require that the folder path already exists. An unknown path then returns 404 instead of creating the folders.

Available options:
true,
false
format
enum<string>

[Image/Video] Re-encode the file to this format before storing.

Available options:
jpeg,
png,
webp,
avif,
gif,
tiff,
mp4,
webm,
mov,
hls,
m3u8
width
integer

[Image/Video] Resize to this width in pixels.

height
integer

[Image/Video] Resize to this height in pixels.

fit
enum<string>

[Image/Video] How the media should fit width/height.

Available options:
cover,
contain,
fill,
inside,
outside
crop
object

[Image] Explicitly crop the image using left, top, width, and height coordinates.

quality
integer

[Image/Video] Output quality (1-100).

fps
integer

[Video Only] Output frame rate for video files (e.g. 24, 30, 60).

videoCodec
enum<string>

[Video Only] Video encoding codec.

Available options:
libx264,
libvpx-vp9,
h264,
hevc
trimStart
number

[Video Only] Trim start timestamp in seconds.

trimEnd
number

[Video Only] Trim end timestamp in seconds.

gravity
enum<string>

[Image Only] Crop anchor point when resizing images.

Available options:
north,
northeast,
east,
southeast,
south,
southwest,
west,
northwest,
center,
attention,
entropy
dpr
number

[Image Only] Device pixel ratio multiplier (max 3).

rotate
enum<integer>

[Image Only] Rotate by this many degrees clockwise.

Available options:
90,
180,
270
bg
string

[Image Only] Hex color (without #) used to pad/fill, e.g. ffffff.

radius
string

[Image Only] Corner radius in pixels, or max for a full circle/pill.

p
string

[Image/Video] A saved transform preset key to apply instead of individual fields.

Response

Media uploaded successfully

id
string
Example:

"med_123456789"

url
string
Example:

"https://cdn.dreep.cloud/med_123456789/hero.jpg"

originalFilename
string
Example:

"hero.jpg"

mimetype
string
Example:

"image/webp"

format
string

Only present for images.

Example:

"webp"

sizeBytes
integer
Example:

245000

width
integer

Only present for images.

Example:

1200

height
integer

Only present for images.

status
string
Example:

"ready"

folderId
string
projectId
string
createdAt
string<date-time>