Move a folder
curl --request POST \
--url https://api.dune.com/api/v1/folders/{folder_id}/move \
--header 'Content-Type: application/json' \
--header 'X-Dune-Api-Key: <x-dune-api-key>' \
--data '
{
"parent_folder_id": "<string>"
}
'import requests
url = "https://api.dune.com/api/v1/folders/{folder_id}/move"
payload = { "parent_folder_id": "<string>" }
headers = {
"X-Dune-Api-Key": "<x-dune-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Dune-Api-Key': '<x-dune-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({parent_folder_id: '<string>'})
};
fetch('https://api.dune.com/api/v1/folders/{folder_id}/move', 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}/move",
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([
'parent_folder_id' => '<string>'
]),
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}/move"
payload := strings.NewReader("{\n \"parent_folder_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.dune.com/api/v1/folders/{folder_id}/move")
.header("X-Dune-Api-Key", "<x-dune-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"parent_folder_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dune.com/api/v1/folders/{folder_id}/move")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Dune-Api-Key"] = '<x-dune-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"parent_folder_id\": \"<string>\"\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
Move Folder
Move a folder, with everything inside it, under another folder, or to the root of the library with parent_folder_id null. A folder cannot move into itself or into one of its subfolders. Moving a folder where it already is changes nothing.
POST
/
v1
/
folders
/
{folder_id}
/
move
Move a folder
curl --request POST \
--url https://api.dune.com/api/v1/folders/{folder_id}/move \
--header 'Content-Type: application/json' \
--header 'X-Dune-Api-Key: <x-dune-api-key>' \
--data '
{
"parent_folder_id": "<string>"
}
'import requests
url = "https://api.dune.com/api/v1/folders/{folder_id}/move"
payload = { "parent_folder_id": "<string>" }
headers = {
"X-Dune-Api-Key": "<x-dune-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Dune-Api-Key': '<x-dune-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({parent_folder_id: '<string>'})
};
fetch('https://api.dune.com/api/v1/folders/{folder_id}/move', 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}/move",
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([
'parent_folder_id' => '<string>'
]),
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}/move"
payload := strings.NewReader("{\n \"parent_folder_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.dune.com/api/v1/folders/{folder_id}/move")
.header("X-Dune-Api-Key", "<x-dune-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"parent_folder_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dune.com/api/v1/folders/{folder_id}/move")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Dune-Api-Key"] = '<x-dune-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"parent_folder_id\": \"<string>\"\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
- Reorganize: Move a folder, with everything inside it, under another folder.
- Move to the Top Level: Pass
parent_folder_id: nullto move a folder to the top level of the library.
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
New parent folder
ParentFolderID is the new parent folder, or null to move the folder to the library root. The field is required so that a missing value never moves a folder by accident.
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?