Update a folder
curl --request PATCH \
--url https://api.dune.com/api/v1/folders/{folder_id} \
--header 'Content-Type: application/json' \
--header 'X-Dune-Api-Key: <x-dune-api-key>' \
--data '
{
"color": "<string>",
"description": "<string>",
"icon": "<string>",
"name": "RWA (2026)"
}
'import requests
url = "https://api.dune.com/api/v1/folders/{folder_id}"
payload = {
"color": "<string>",
"description": "<string>",
"icon": "<string>",
"name": "RWA (2026)"
}
headers = {
"X-Dune-Api-Key": "<x-dune-api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Dune-Api-Key': '<x-dune-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
color: '<string>',
description: '<string>',
icon: '<string>',
name: 'RWA (2026)'
})
};
fetch('https://api.dune.com/api/v1/folders/{folder_id}', 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.dune.com/api/v1/folders/{folder_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'color' => '<string>',
'description' => '<string>',
'icon' => '<string>',
'name' => 'RWA (2026)'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Dune-Api-Key: <x-dune-api-key>"
],
]);
$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.dune.com/api/v1/folders/{folder_id}"
payload := strings.NewReader("{\n \"color\": \"<string>\",\n \"description\": \"<string>\",\n \"icon\": \"<string>\",\n \"name\": \"RWA (2026)\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Dune-Api-Key", "<x-dune-api-key>")
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.patch("https://api.dune.com/api/v1/folders/{folder_id}")
.header("X-Dune-Api-Key", "<x-dune-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"color\": \"<string>\",\n \"description\": \"<string>\",\n \"icon\": \"<string>\",\n \"name\": \"RWA (2026)\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dune.com/api/v1/folders/{folder_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Dune-Api-Key"] = '<x-dune-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"color\": \"<string>\",\n \"description\": \"<string>\",\n \"icon\": \"<string>\",\n \"name\": \"RWA (2026)\"\n}"
response = http.request(request)
puts response.read_body{
"color": "blue",
"created_at": "<string>",
"description": "<string>",
"folder_id": "dp180Cu3jW3L",
"icon": "folder",
"name": "RWA",
"parent_folder_id": "aZ3kP0qLm9Xc",
"path": "/Research/RWA",
"updated_at": "<string>"
}{
"code": "folder_not_found",
"details": {
"dashboard_count": 123,
"existing_folder_id": "<string>",
"query_count": 123,
"subfolder_count": 123
},
"error": "Folder not found"
}{
"error": "Invalid API Key"
}{
"code": "folder_not_found",
"details": {
"dashboard_count": 123,
"existing_folder_id": "<string>",
"query_count": 123,
"subfolder_count": 123
},
"error": "Folder not found"
}{
"code": "folder_not_found",
"details": {
"dashboard_count": 123,
"existing_folder_id": "<string>",
"query_count": 123,
"subfolder_count": 123
},
"error": "Folder not found"
}{
"code": "folder_not_found",
"details": {
"dashboard_count": 123,
"existing_folder_id": "<string>",
"query_count": 123,
"subfolder_count": 123
},
"error": "Folder not found"
}{
"error": "Internal error"
}Folders
Update Folder
Change a folder’s name, description, icon or color. Fields that are omitted keep their value. Renaming a folder also renames the paths of every folder below it.
PATCH
/
v1
/
folders
/
{folder_id}
Update a folder
curl --request PATCH \
--url https://api.dune.com/api/v1/folders/{folder_id} \
--header 'Content-Type: application/json' \
--header 'X-Dune-Api-Key: <x-dune-api-key>' \
--data '
{
"color": "<string>",
"description": "<string>",
"icon": "<string>",
"name": "RWA (2026)"
}
'import requests
url = "https://api.dune.com/api/v1/folders/{folder_id}"
payload = {
"color": "<string>",
"description": "<string>",
"icon": "<string>",
"name": "RWA (2026)"
}
headers = {
"X-Dune-Api-Key": "<x-dune-api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Dune-Api-Key': '<x-dune-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
color: '<string>',
description: '<string>',
icon: '<string>',
name: 'RWA (2026)'
})
};
fetch('https://api.dune.com/api/v1/folders/{folder_id}', 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.dune.com/api/v1/folders/{folder_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'color' => '<string>',
'description' => '<string>',
'icon' => '<string>',
'name' => 'RWA (2026)'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Dune-Api-Key: <x-dune-api-key>"
],
]);
$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.dune.com/api/v1/folders/{folder_id}"
payload := strings.NewReader("{\n \"color\": \"<string>\",\n \"description\": \"<string>\",\n \"icon\": \"<string>\",\n \"name\": \"RWA (2026)\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Dune-Api-Key", "<x-dune-api-key>")
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.patch("https://api.dune.com/api/v1/folders/{folder_id}")
.header("X-Dune-Api-Key", "<x-dune-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"color\": \"<string>\",\n \"description\": \"<string>\",\n \"icon\": \"<string>\",\n \"name\": \"RWA (2026)\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dune.com/api/v1/folders/{folder_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Dune-Api-Key"] = '<x-dune-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"color\": \"<string>\",\n \"description\": \"<string>\",\n \"icon\": \"<string>\",\n \"name\": \"RWA (2026)\"\n}"
response = http.request(request)
puts response.read_body{
"color": "blue",
"created_at": "<string>",
"description": "<string>",
"folder_id": "dp180Cu3jW3L",
"icon": "folder",
"name": "RWA",
"parent_folder_id": "aZ3kP0qLm9Xc",
"path": "/Research/RWA",
"updated_at": "<string>"
}{
"code": "folder_not_found",
"details": {
"dashboard_count": 123,
"existing_folder_id": "<string>",
"query_count": 123,
"subfolder_count": 123
},
"error": "Folder not found"
}{
"error": "Invalid API Key"
}{
"code": "folder_not_found",
"details": {
"dashboard_count": 123,
"existing_folder_id": "<string>",
"query_count": 123,
"subfolder_count": 123
},
"error": "Folder not found"
}{
"code": "folder_not_found",
"details": {
"dashboard_count": 123,
"existing_folder_id": "<string>",
"query_count": 123,
"subfolder_count": 123
},
"error": "Folder not found"
}{
"code": "folder_not_found",
"details": {
"dashboard_count": 123,
"existing_folder_id": "<string>",
"query_count": 123,
"subfolder_count": 123
},
"error": "Folder not found"
}{
"error": "Internal error"
}Minimum required API key scope:
Read/WriteUse Cases
- Rename: Change a folder’s name. The paths of all its subfolders update with it.
- Label Folders: Set a description, a color, or an icon to make folders easier to find.
Headers
API Key for the service
Path Parameters
Folder id
Query Parameters
API Key, alternative to using the HTTP header X-Dune-Api-Key
Body
application/json
Fields to change
Response
OK
Color is a preset name or a hex value.
Example:
"blue"
Example:
"dp180Cu3jW3L"
Example:
"folder"
Example:
"RWA"
ParentFolderID is null for a folder at the library root.
Example:
"aZ3kP0qLm9Xc"
Path is the full path from the library root.
Example:
"/Research/RWA"
Was this page helpful?