Move queries and dashboards
curl --request POST \
--url https://api.dune.com/api/v1/content/move \
--header 'Content-Type: application/json' \
--header 'X-Dune-Api-Key: <x-dune-api-key>' \
--data '
{
"target_folder_id": "<string>",
"dashboard_ids": [
98765
],
"query_ids": [
4512345
]
}
'import requests
url = "https://api.dune.com/api/v1/content/move"
payload = {
"target_folder_id": "<string>",
"dashboard_ids": [98765],
"query_ids": [4512345]
}
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({target_folder_id: '<string>', dashboard_ids: [98765], query_ids: [4512345]})
};
fetch('https://api.dune.com/api/v1/content/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/content/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([
'target_folder_id' => '<string>',
'dashboard_ids' => [
98765
],
'query_ids' => [
4512345
]
]),
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/content/move"
payload := strings.NewReader("{\n \"target_folder_id\": \"<string>\",\n \"dashboard_ids\": [\n 98765\n ],\n \"query_ids\": [\n 4512345\n ]\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/content/move")
.header("X-Dune-Api-Key", "<x-dune-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"target_folder_id\": \"<string>\",\n \"dashboard_ids\": [\n 98765\n ],\n \"query_ids\": [\n 4512345\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dune.com/api/v1/content/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 \"target_folder_id\": \"<string>\",\n \"dashboard_ids\": [\n 98765\n ],\n \"query_ids\": [\n 4512345\n ]\n}"
response = http.request(request)
puts response.read_body{
"moved_dashboard_ids": [
123
],
"moved_query_ids": [
123
],
"target_folder": {
"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"
}{
"error": "Internal error"
}Folders
Move Queries and Dashboards
Move up to 100 queries and 100 dashboards into a folder, or out of folders with target_folder_id null. All or nothing: every item must belong to the API key’s library and be editable through it; otherwise nothing moves.
POST
/
v1
/
content
/
move
Move queries and dashboards
curl --request POST \
--url https://api.dune.com/api/v1/content/move \
--header 'Content-Type: application/json' \
--header 'X-Dune-Api-Key: <x-dune-api-key>' \
--data '
{
"target_folder_id": "<string>",
"dashboard_ids": [
98765
],
"query_ids": [
4512345
]
}
'import requests
url = "https://api.dune.com/api/v1/content/move"
payload = {
"target_folder_id": "<string>",
"dashboard_ids": [98765],
"query_ids": [4512345]
}
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({target_folder_id: '<string>', dashboard_ids: [98765], query_ids: [4512345]})
};
fetch('https://api.dune.com/api/v1/content/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/content/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([
'target_folder_id' => '<string>',
'dashboard_ids' => [
98765
],
'query_ids' => [
4512345
]
]),
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/content/move"
payload := strings.NewReader("{\n \"target_folder_id\": \"<string>\",\n \"dashboard_ids\": [\n 98765\n ],\n \"query_ids\": [\n 4512345\n ]\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/content/move")
.header("X-Dune-Api-Key", "<x-dune-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"target_folder_id\": \"<string>\",\n \"dashboard_ids\": [\n 98765\n ],\n \"query_ids\": [\n 4512345\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dune.com/api/v1/content/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 \"target_folder_id\": \"<string>\",\n \"dashboard_ids\": [\n 98765\n ],\n \"query_ids\": [\n 4512345\n ]\n}"
response = http.request(request)
puts response.read_body{
"moved_dashboard_ids": [
123
],
"moved_query_ids": [
123
],
"target_folder": {
"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"
}{
"error": "Internal error"
}Minimum required API key scope:
Read/WriteUse Cases
- File New Work: Move queries and dashboards an agent just created into the right folder.
- Bulk Moves: Move up to 100 queries and 100 dashboards in one call. The move is all or nothing.
- Take Content Out of Folders: Pass
target_folder_id: nullto move items out of all folders.
Headers
API Key for the service
Query Parameters
API Key, alternative to using the HTTP header X-Dune-Api-Key
Body
application/json
Content to move and its destination
TargetFolderID is the destination folder, or null to take the content out of folders. The field is required so that a missing value never moves content by accident.
Maximum array length:
100Example:
[98765]
Maximum array length:
100Example:
[4512345]
Was this page helpful?