Create Presigned Upload
curl --request POST \
--url https://api.dreep.cloud/api/v1/upload/presign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contentType": "image/webp",
"sizeBytes": 438720,
"filename": "me.webp",
"folder": "avatars/2024",
"key": "avatars/2024/me.webp",
"folderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"autoCreateFolders": "true",
"format": "<string>",
"presetKey": "<string>",
"contentHash": "<string>"
}
'import requests
url = "https://api.dreep.cloud/api/v1/upload/presign"
payload = {
"contentType": "image/webp",
"sizeBytes": 438720,
"filename": "me.webp",
"folder": "avatars/2024",
"key": "avatars/2024/me.webp",
"folderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"autoCreateFolders": "true",
"format": "<string>",
"presetKey": "<string>",
"contentHash": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contentType: 'image/webp',
sizeBytes: 438720,
filename: 'me.webp',
folder: 'avatars/2024',
key: 'avatars/2024/me.webp',
folderId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
autoCreateFolders: 'true',
format: '<string>',
presetKey: '<string>',
contentHash: '<string>'
})
};
fetch('https://api.dreep.cloud/api/v1/upload/presign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dreep.cloud/api/v1/upload/presign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contentType' => 'image/webp',
'sizeBytes' => 438720,
'filename' => 'me.webp',
'folder' => 'avatars/2024',
'key' => 'avatars/2024/me.webp',
'folderId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'autoCreateFolders' => 'true',
'format' => '<string>',
'presetKey' => '<string>',
'contentHash' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dreep.cloud/api/v1/upload/presign"
payload := strings.NewReader("{\n \"contentType\": \"image/webp\",\n \"sizeBytes\": 438720,\n \"filename\": \"me.webp\",\n \"folder\": \"avatars/2024\",\n \"key\": \"avatars/2024/me.webp\",\n \"folderId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"autoCreateFolders\": \"true\",\n \"format\": \"<string>\",\n \"presetKey\": \"<string>\",\n \"contentHash\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.dreep.cloud/api/v1/upload/presign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contentType\": \"image/webp\",\n \"sizeBytes\": 438720,\n \"filename\": \"me.webp\",\n \"folder\": \"avatars/2024\",\n \"key\": \"avatars/2024/me.webp\",\n \"folderId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"autoCreateFolders\": \"true\",\n \"format\": \"<string>\",\n \"presetKey\": \"<string>\",\n \"contentHash\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dreep.cloud/api/v1/upload/presign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contentType\": \"image/webp\",\n \"sizeBytes\": 438720,\n \"filename\": \"me.webp\",\n \"folder\": \"avatars/2024\",\n \"key\": \"avatars/2024/me.webp\",\n \"folderId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"autoCreateFolders\": \"true\",\n \"format\": \"<string>\",\n \"presetKey\": \"<string>\",\n \"contentHash\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"uploadUrl": "<string>",
"contentType": "<string>",
"alreadyExists": true
}{
"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
Create Presigned Upload
Get a short-lived URL to upload file bytes straight to storage, bypassing the API.
POST
/
api
/
v1
/
upload
/
presign
Create Presigned Upload
curl --request POST \
--url https://api.dreep.cloud/api/v1/upload/presign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contentType": "image/webp",
"sizeBytes": 438720,
"filename": "me.webp",
"folder": "avatars/2024",
"key": "avatars/2024/me.webp",
"folderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"autoCreateFolders": "true",
"format": "<string>",
"presetKey": "<string>",
"contentHash": "<string>"
}
'import requests
url = "https://api.dreep.cloud/api/v1/upload/presign"
payload = {
"contentType": "image/webp",
"sizeBytes": 438720,
"filename": "me.webp",
"folder": "avatars/2024",
"key": "avatars/2024/me.webp",
"folderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"autoCreateFolders": "true",
"format": "<string>",
"presetKey": "<string>",
"contentHash": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contentType: 'image/webp',
sizeBytes: 438720,
filename: 'me.webp',
folder: 'avatars/2024',
key: 'avatars/2024/me.webp',
folderId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
autoCreateFolders: 'true',
format: '<string>',
presetKey: '<string>',
contentHash: '<string>'
})
};
fetch('https://api.dreep.cloud/api/v1/upload/presign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dreep.cloud/api/v1/upload/presign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contentType' => 'image/webp',
'sizeBytes' => 438720,
'filename' => 'me.webp',
'folder' => 'avatars/2024',
'key' => 'avatars/2024/me.webp',
'folderId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'autoCreateFolders' => 'true',
'format' => '<string>',
'presetKey' => '<string>',
'contentHash' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dreep.cloud/api/v1/upload/presign"
payload := strings.NewReader("{\n \"contentType\": \"image/webp\",\n \"sizeBytes\": 438720,\n \"filename\": \"me.webp\",\n \"folder\": \"avatars/2024\",\n \"key\": \"avatars/2024/me.webp\",\n \"folderId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"autoCreateFolders\": \"true\",\n \"format\": \"<string>\",\n \"presetKey\": \"<string>\",\n \"contentHash\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.dreep.cloud/api/v1/upload/presign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contentType\": \"image/webp\",\n \"sizeBytes\": 438720,\n \"filename\": \"me.webp\",\n \"folder\": \"avatars/2024\",\n \"key\": \"avatars/2024/me.webp\",\n \"folderId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"autoCreateFolders\": \"true\",\n \"format\": \"<string>\",\n \"presetKey\": \"<string>\",\n \"contentHash\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dreep.cloud/api/v1/upload/presign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contentType\": \"image/webp\",\n \"sizeBytes\": 438720,\n \"filename\": \"me.webp\",\n \"folder\": \"avatars/2024\",\n \"key\": \"avatars/2024/me.webp\",\n \"folderId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"autoCreateFolders\": \"true\",\n \"format\": \"<string>\",\n \"presetKey\": \"<string>\",\n \"contentHash\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"uploadUrl": "<string>",
"contentType": "<string>",
"alreadyExists": true
}{
"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"
}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:
POST /api/v1/upload/presign→ returns anidand anuploadUrl.PUTthe raw file bytes touploadUrl, with aContent-Typematching thecontentTypeyou declared.POST /api/v1/upload/{id}/confirmto finalize the asset.
pending and is excluded from media listings.
Destination
The destination folder is named exactly as it is for a direct upload — withfolder, 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
SendcontentHash (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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Example:
"image/webp"
Example:
438720
Name to store the file under. Optional if key is given (its last segment supplies it), or if omitted entirely a name is generated for you.
Example:
"me.webp"
Slug path of the destination folder. Missing folders are created.
Example:
"avatars/2024"
Full S3-style object key (folder path + filename).
Example:
"avatars/2024/me.webp"
UUID of an existing destination folder.
Available options:
true, false Target format to re-encode to on confirm.
SHA-256 of the file, used to skip re-uploading content Dreep already has.