Skip to main content
POST
Create Presigned Upload
Use this instead of Upload Media for large files and browser uploads — the bytes go directly to storage and never pass through the Dreep API. The flow is three steps:
  1. POST /api/v1/upload/presign → returns an id and an uploadUrl.
  2. PUT the raw file bytes to uploadUrl, with a Content-Type matching the contentType you declared.
  3. POST /api/v1/upload/{id}/confirm to finalize the asset.
Until step 3 the asset stays pending and is excluded from media listings.

Destination

The destination folder is named exactly as it is for a direct upload — with folder, key, or folderId — and missing folders are created for you. When you pass a key, its last segment supplies the filename, so filename becomes optional. See Folders & Paths.

Skipping the upload for content Dreep already has

Send contentHash (the SHA-256 of the file). If it matches content already in storage, the response has "alreadyExists": true and no uploadUrl — skip the PUT and go straight to confirm.
The uploadUrl is short-lived and single-purpose. Generate it server-side and hand it to the client immediately; don’t cache or reuse it.

Authorizations

Authorization
string
header
required

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

Body

application/json
contentType
string
required
Example:

"image/webp"

sizeBytes
integer
required
Example:

438720

filename
string

Name to store the file under. Optional when key is given, since the key's last segment supplies it.

Example:

"me.webp"

folder
string

Slug path of the destination folder. Missing folders are created.

Example:

"avatars/2024"

key
string

Full S3-style object key (folder path + filename).

Example:

"avatars/2024/me.webp"

folderId
string<uuid>

UUID of an existing destination folder.

autoCreateFolders
enum<string>
default:true
Available options:
true,
false
format
string

Target format to re-encode to on confirm.

presetKey
string
contentHash
string

SHA-256 of the file, used to skip re-uploading content Dreep already has.

Response

Presigned upload created

id
string<uuid>

Pass this to the confirm endpoint.

uploadUrl
string

Short-lived URL to PUT the file bytes to. Absent when alreadyExists is true.

contentType
string
alreadyExists
boolean