Create Folder
curl --request POST \
--url https://api.dreep.cloud/api/v1/folders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Marketing Assets",
"path": "2024/q1/launch",
"parentId": "78b52933-5541-4e90-8c15-39a84a412da8",
"parentPath": "avatars/2024",
"accessControlType": "signed",
"defaultExpirySeconds": 3600
}
'import requests
url = "https://api.dreep.cloud/api/v1/folders"
payload = {
"name": "Marketing Assets",
"path": "2024/q1/launch",
"parentId": "78b52933-5541-4e90-8c15-39a84a412da8",
"parentPath": "avatars/2024",
"accessControlType": "signed",
"defaultExpirySeconds": 3600
}
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({
name: 'Marketing Assets',
path: '2024/q1/launch',
parentId: '78b52933-5541-4e90-8c15-39a84a412da8',
parentPath: 'avatars/2024',
accessControlType: 'signed',
defaultExpirySeconds: 3600
})
};
fetch('https://api.dreep.cloud/api/v1/folders', 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/folders",
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([
'name' => 'Marketing Assets',
'path' => '2024/q1/launch',
'parentId' => '78b52933-5541-4e90-8c15-39a84a412da8',
'parentPath' => 'avatars/2024',
'accessControlType' => 'signed',
'defaultExpirySeconds' => 3600
]),
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/folders"
payload := strings.NewReader("{\n \"name\": \"Marketing Assets\",\n \"path\": \"2024/q1/launch\",\n \"parentId\": \"78b52933-5541-4e90-8c15-39a84a412da8\",\n \"parentPath\": \"avatars/2024\",\n \"accessControlType\": \"signed\",\n \"defaultExpirySeconds\": 3600\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/folders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Marketing Assets\",\n \"path\": \"2024/q1/launch\",\n \"parentId\": \"78b52933-5541-4e90-8c15-39a84a412da8\",\n \"parentPath\": \"avatars/2024\",\n \"accessControlType\": \"signed\",\n \"defaultExpirySeconds\": 3600\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dreep.cloud/api/v1/folders")
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 \"name\": \"Marketing Assets\",\n \"path\": \"2024/q1/launch\",\n \"parentId\": \"78b52933-5541-4e90-8c15-39a84a412da8\",\n \"parentPath\": \"avatars/2024\",\n \"accessControlType\": \"signed\",\n \"defaultExpirySeconds\": 3600\n}"
response = http.request(request)
puts response.read_body{
"path": "2024/q1/launch",
"id": "<string>",
"name": "<string>"
}{
"error": true,
"message": "Invalid request parameters",
"code": "invalid_request"
}{
"error": true,
"message": "Invalid request parameters",
"code": "invalid_request"
}Folders
Create Folder
Create a folder to organize uploads. Pass name to create a single folder, or path to create a whole nested chain (2024/q1/launch) in one call — only the missing segments are created, and the leaf is returned.
Note that uploads create folders on demand too, so calling this first is only necessary when you want to set accessControlType or defaultExpirySeconds up front.
accessControlType controls who can view assets inside the folder once uploaded, and is inherited by any subfolder created beneath it: - public (default): fetchable by anyone via /api/v1/fetch/{mediaId}. - private: only viewable by an authenticated project member from
the Dreep dashboard — never fetchable through the public API.
- signed: not fetchable with a bare URL, but a time-limited link can be generated from the Dreep dashboard and shared with anyone, no API key required to use it. See Fetch Media for how signed links work.
POST
/
api
/
v1
/
folders
Create Folder
curl --request POST \
--url https://api.dreep.cloud/api/v1/folders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Marketing Assets",
"path": "2024/q1/launch",
"parentId": "78b52933-5541-4e90-8c15-39a84a412da8",
"parentPath": "avatars/2024",
"accessControlType": "signed",
"defaultExpirySeconds": 3600
}
'import requests
url = "https://api.dreep.cloud/api/v1/folders"
payload = {
"name": "Marketing Assets",
"path": "2024/q1/launch",
"parentId": "78b52933-5541-4e90-8c15-39a84a412da8",
"parentPath": "avatars/2024",
"accessControlType": "signed",
"defaultExpirySeconds": 3600
}
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({
name: 'Marketing Assets',
path: '2024/q1/launch',
parentId: '78b52933-5541-4e90-8c15-39a84a412da8',
parentPath: 'avatars/2024',
accessControlType: 'signed',
defaultExpirySeconds: 3600
})
};
fetch('https://api.dreep.cloud/api/v1/folders', 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/folders",
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([
'name' => 'Marketing Assets',
'path' => '2024/q1/launch',
'parentId' => '78b52933-5541-4e90-8c15-39a84a412da8',
'parentPath' => 'avatars/2024',
'accessControlType' => 'signed',
'defaultExpirySeconds' => 3600
]),
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/folders"
payload := strings.NewReader("{\n \"name\": \"Marketing Assets\",\n \"path\": \"2024/q1/launch\",\n \"parentId\": \"78b52933-5541-4e90-8c15-39a84a412da8\",\n \"parentPath\": \"avatars/2024\",\n \"accessControlType\": \"signed\",\n \"defaultExpirySeconds\": 3600\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/folders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Marketing Assets\",\n \"path\": \"2024/q1/launch\",\n \"parentId\": \"78b52933-5541-4e90-8c15-39a84a412da8\",\n \"parentPath\": \"avatars/2024\",\n \"accessControlType\": \"signed\",\n \"defaultExpirySeconds\": 3600\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dreep.cloud/api/v1/folders")
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 \"name\": \"Marketing Assets\",\n \"path\": \"2024/q1/launch\",\n \"parentId\": \"78b52933-5541-4e90-8c15-39a84a412da8\",\n \"parentPath\": \"avatars/2024\",\n \"accessControlType\": \"signed\",\n \"defaultExpirySeconds\": 3600\n}"
response = http.request(request)
puts response.read_body{
"path": "2024/q1/launch",
"id": "<string>",
"name": "<string>"
}{
"error": true,
"message": "Invalid request parameters",
"code": "invalid_request"
}{
"error": true,
"message": "Invalid request parameters",
"code": "invalid_request"
}Uploads create folders on demand, so you usually don’t need this endpoint. Reach
for it when you want to set
accessControlType or defaultExpirySeconds on a
folder before anything is uploaded into it.One folder, or a whole chain
Passname to create a single folder, optionally under a parent (parentId or
parentPath):
curl -X POST https://api.dreep.cloud/api/v1/folders \
-H "Authorization: Bearer drp_live_xxxxx" \
-H "Content-Type: application/json" \
-d '{ "name": "q1", "parentPath": "invoices/2024" }'
path to create every missing segment in one call and get the leaf
back:
curl -X POST https://api.dreep.cloud/api/v1/folders \
-H "Authorization: Bearer drp_live_xxxxx" \
-H "Content-Type: application/json" \
-d '{
"path": "invoices/2024/q1",
"accessControlType": "signed",
"defaultExpirySeconds": 86400
}'
path is always relative to the project root, so it can’t be combined with
parentId or parentPath. Segments already present are reused, never
duplicated — the call is safe to repeat.
Access control
accessControlType and defaultExpirySeconds apply to the last segment.
Any intermediate folders created along the way inherit from their parent, so
building invoices/2024/q1 under a Private invoices never produces a public
folder in between. See Folders & Access Control.
Naming
Names are normalized to slugs — lowercased, with disallowed characters stripped and separators collapsed.Marketing Assets becomes marketing-assets, and
creating it twice returns the same folder rather than a duplicate. The original
text is kept as the folder’s display name. See
Folders & Paths.Authorizations
Body
application/json
- Option 1
- Option 2